lundi 7 décembre 2015

What is the most efficient way to do rows ordering in SQLite table?

I need to keep order of about 4000 rows in SQLite table. Inserting and deleting of rows need to be quick operation.

Current solution: I have integer column Ord. After every insertion Ord in new row just gets next integer so no need to change old rows but after deletion sometimes I need to re-populate almost all 4000 rows and it takes too long (~10s). For updating of this column I use this solution Update SQLite table with values from 1 to N

Is there a better way to maintain ordering?

Aucun commentaire:

Enregistrer un commentaire