User-defined Order in SQL

1 · Joe Nelson · March 20, 2018, midnight
Some applications, such as todo lists, need to maintain a user-defined order of items. The challenge is that the order is arbitrary and can change when the user rearranges items: reordering a list in a gui This article investigates the best way to model the situation in SQL. We’ll examine several ways to do it, and will assess three properties for each: Efficiency in space and time. Storing row order should be compact on disk, and re-ordering items should use minimal CPU and I/O resources. R...