On Mon, Apr 12, 2010 at 9:14 AM, Igor Tandetnik <itandet...@mvps.org> wrote:

> Mike Goins wrote:
> > sqlite> explain query plan SELECT tb_file_key, basename, extension,
> > path FROM tb_file WHERE basename GLOB 'a' AND  extension GLOB 'b' AND
> >  path GLOB '*';
> > 0|0|TABLE tb_file WITH INDEX fullpath_idx
> >
> >
> > The last one with the leading wildcard doesn't look like it should use
> > the index.
>
> SQLite can use the index to satisfy conditions on basename and extension,
> then do a full scan of what's left.
> --
> Igor Tandetnik
>
>

SQLite will not try to optimize a GLOB (to use an index) if it doesn't
contain wild cards -- although it probably should.
This optimization has been added to our list for a possible future
enhancement.

As a workaround, as has been noted, you could simply use the  foo = 'b'
instead of foo GLOB 'b'.

-Shane
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to