Am Sonntag, 23. März 2014, 14:00:38 schrieb Pedro Côrte-Real:
> On Sun, Mar 23, 2014 at 1:53 PM, Pedro Côrte-Real <[email protected]> wrote:
> > Had a look through the code and this is actually wrong. It's worse.
> > What's actually happening is that for each image import a SELECT is
> > done on the database to see if we already have an image with that
> > filename. Apparently sqlite is doing a full table scan for this.
> > 
> > The solution should be simple enough, just add an index to the
> > filename field of the images table so that this doesn't take a full
> > table scan and becomes O(1) instead of O(n). Hopefully sqlite will
> > know to do the right thing, I've had bad experiences in the past with
> > it doing slow queries even with indexes available.
> 
> Filed a bug report for this:
> 
> http://www.darktable.org/redmine/issues/9872

Thanks for looking into this.

I added an index on images.filename to git master. It /might/ be better to add 
it on (film_id, filename) but since we already have one on film_id I hope that 
sqlite is smart enough to make use of the two.

If you are able to compile darktable from git master I would be happy to hear 
back if this improves things.

Otherwise you could try to

cd ~/.config/darktable/
cp library.db library.db.pre-index
sqlite3 library.db
CREATE INDEX images_film_id_filename_index ON images (film_id, filename);
ctrl-d

and retry.

> Pedro

Tobias

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Darktable-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/darktable-users

Reply via email to