Get the latest tech news
User-defined Order in SQL (2018)
Re-ordering a todo list
It’s unusual for the numeric type to exceed 128 bits if there aren’t many list rearrangements, and most operations on the column will be indexed comparisons, not arithmetic. For instance you can see from the tree diagram earlier that inserting between 1 and 0 toward 0 generates 1/2, 1/3, 1/4 … which can go a very long time because numerators and denominators in pg_rational each get 32 bits of storage. Other fractions may pose more difficulties for the float representation, but from my limited experiments it looks like this way of choosing midpoints works a lot better than taking averages.
Or read this on Hacker News