Hacker News new | past | comments | ask | show | jobs | submit login

What about storing all the item ids in a text array (on another table, one related to these items somehow)?

  int[]
If the items are being ordered manually by the user, then they cannot be of a very large length.



That may meet your needs. You’ll lose some of the benefits of database constraints and indexing.

And while the submission uses it as an example, the use case of reordering items in a list needn’t be limited to lists manually ordered by a user.


It's not "an example", it's the entire point of the article.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: