Best representation of an ordered list in a database?

后端 未结 5 495
礼貌的吻别
礼貌的吻别 2020-11-28 04:08

I know that this sort of goes against the principles of a relational database but let me describe the situation.

I have a page where the user will place a number of

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 04:45

    If you expect number of items is not huge, you can use a bit modified version of your first approach. Just make gap between consecutive indexes. For example, first item has index 100, second 200, etc. This way you don't have to update all indexes every time, only if you cannot find a gap

提交回复
热议问题