News for hackers. Stuff that matters.
Re:User-defined Order in SQL by gns24 on Wednesday March 21, 2018 @05:20AM (#16636558)
Exactly. If we're storing the positional value into 64-bits then there must be some patterns of 64 inserts which don't fit.

The decimal solution is really not bad. You could improve on it by not taking the midpoint between the two values you're inserting between, but rather another point which doesn't require an extra digit, when that's possible, but really that's very likely to be an unnecessary optimisation. So continual insertion on the end might give 0.5, 0.8, 0.9, 0.95, 0.98 0.99, 0.995...

Re:User-defined Order in SQL by arnioxux on Wednesday March 21, 2018 @05:31AM (#16636594)
That's a really elegant way to put it. Yay for information theory.
Re:User-defined Order in SQL by bhandziuk on Wednesday March 21, 2018 @04:12PM (#16641893)
What if, periodically, the orders are recalculated? Like 95% of cases are not going to reorder items back and forth 64 times in a session. If that does happen then take the extra time to reset everything (1,2,3,4...).

And maybe periodically do the same for all values in your table? Like when users are not interacting with the items maybe.