Many tables in our db is using a field "display_order" to decide the order of records on the screen. And we are using int for this field. In the beginning, when we insert records, we will leave some gap between them, e.g., first record we give display_order = 0, second record display_order = 1000. In this way we have some gap between first and second record. So if we want to insert a new record in between these two, we can give a display_order = 500.
This approach has a limitation that when you run out of the gap between 2 adjacent records, you have to start updating display_order for many records in order to make some gap.
I have thought of using floating point or just string for this, but not sure that will hurt comparing performance.
What do you think of this from your experience?
Cheers, Elton