4 ms·
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
by fiatjaf 9y ago
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.
- grzm 9y agoThat 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.
- fiatjaf 9y agoIt's not "an example", it's the entire point of the article.