Re:User-defined Order in SQL
by rdiddly on Wednesday March 21, 2018 @02:26AM
(#16635960)
Well I think this achieves minimal rewrites, but you do lose a bit on indexing. You can't retrieve by numeric position index for example. But reproducing the order is just a matter of starting from the head (where PrecededById is null) or from any point and then repeatedly selecting the entry whose PrecededById = the current ID.
[ Parent
| on HN ]
That's more than a bit on indexing. Following a linked list through repeated selections is not nearly as efficient as an index scan.