On 9 Jan 2018, at 9:50am, Eric Grange <zar...@gmail.com> wrote:
> then I fill that table with something like
> INSERT INTO RANKED
> SELECT key, value
> FROM ...something rather complex and big...
> ORDER BY value desc
> This works well enough, but as the amount of values to be ranked increases,
> this feels wasteful to delete everything and then re-insert
> everything just to adjust the RANK column, also I am running into memory
> issues as the ORDER BY requires a temporary b-tree
> which runs into the gigabyte range in some instances.
The ORDER BY clause serves no useful value here. Leave it out. Do your
sorting when you query the table.
sqlite-users mailing list