-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daniel Wickes wrote:
> I'm trying to optimise some of my queries, and I would like to know if
> bitwise operators in terms will still use an index,

SQLite provides you the tools to find out for yourself.  In the shell do
'.explain' and then give it your query prefixed with 'EXPLAIN'.  You'll get
the virtual db engine code for the query printed out.

This page gives a rough guide to vdbe code.  (It does now use registers
rather than a stack.)

  http://www.sqlite.org/vdbe.html

By far the easiest thing to do is explain a query you know uses the index
and then explain your query and look for the differences.

In answer to your question, yes the index is used.  You can see instructions
prefixed by Idx that aren't there when the index doesn't exist.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrO93oACgkQmOOfHg372QRXNQCeNSQ1r3o07Yj4n0RZ+kn9ePyT
cy8An05WyzhnU9M8Y3+00dFf4/tOh6vH
=hOpS
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to