logoalt Hacker News

braggerxyzyesterday at 9:24 AM5 repliesview on HN

> ... and sort LEGO bricks by colour

You never sort by color, ever! You sort by form, and then throw every color of that specific form in one bin. If you throw every red brick in the same bin, you'll never find a specific formed red brick because to many red bricks. But if you first search by form and then by color, you are much faster.


Replies

phs318uyesterday at 9:39 AM

As any DBA worth their salt knows.

Index the many valued column, not the column with few discrete values.

show 1 reply
martin-adamsyesterday at 10:02 AM

As someone who tried to sort many lego sets lately, I do like this. The problem lies that modern lego has so many unique forms that it feels like you'll have many bins with one or two pieces in.

show 4 replies
em-beeyesterday at 10:27 AM

counterpoint (don't take this to seriously):

there are to many types of bricks to sort by form. unless you have an inventory the size of a brick factory you can only sort by category or by size.

otherwise, sorting by color makes your collection aesthetically pleasing, and when you build, you usually want to use specific colors only to make your model look good.

show 2 replies
otabdeveloper4yesterday at 2:38 PM

Unfortunately there are so many bespoke LEGO brick forms that this doesn't work.

huflungdungyesterday at 9:32 AM

[dead]