Remix.run Logo
phs318u 4 hours ago

As any DBA worth their salt knows.

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

vanviegen 4 hours ago | parent [-]

Are you sure that's a good strategy if every unique index value requires you to buy a physical container?

layer8 2 hours ago | parent | next [-]

You would use arrays: http://brickarchitect.com/wp-content/uploads/2017/03/IMG_639...

fxtentacle 2 hours ago | parent | prev | next [-]

How about arithmetic coding? That will give you the highest amount of entropy reduction for any possible number of containers. Which probably means that you’ll sort similar pieces far apart but group by colors that are easy to separate, like red+yellow, brown+green

Dylan16807 3 hours ago | parent | prev | next [-]

You can put a few shapes into one container and it's still much faster than searching color-first.

vidarh 3 hours ago | parent | prev [-]

Radix sort. Decide how many containers you're fine with, and group accordingly.