On 10/03/2019 09:31, Pascal Obry wrote:
Ok, I may have an idea.
Can you do that:
- backup your library.db
- run
$ sqlite3 library.db
And enter the following command at the "sqlite >" prompt.
CREATE INDEX tagged_images_index ON tagged_images (imgid, tagid);
And test again. If still slow you may try:
CREATE INDEX tagged_images_imgid_index ON tagged_images (imgid);
Thanks.
Sorry for intruding, but as I'm a DBA guy… :)
That's a bit weird if these indexes improve anything:
(imgid,tagid) is the primary key, so it's auto-indexed.
And a composed index on (imgid,tagid) is perfectly capable of answering
questions on predicates on imgid alone. In this 2-column tables case,
it's theoretically even more efficient than having an index on only
imgid, as it saves a trip to the table to fetch tagid (as the index
contains all required columns).
So in adding these indexes improved anything, wouldn't it mean that
there was something fishy on the table ? (missing primary key for instance…)
Regards
____________________________________________________________________________
darktable user mailing list
to unsubscribe send a mail to darktable-user+unsubscr...@lists.darktable.org