Christian Smith <[EMAIL PROTECTED]> wrote:
> 
> >
> >> Now, all lookups used to implement the view are done using index lookups.
> >
> >Can I check that a query use the index?
> 
> 
> You can examine the output of "explain <sql query>" in the sqlite shell.
> You should get something like:
> 
> xx|OpenRead|xx|xx|(pairs autoindex 1)
> 
> for each cursor that iterates through the pairs table. There should be a
> cursor per field in the view.
> 

There is a new undocumented feature of SQLite that makes this
easier:

    explain query plan <sql-query>

This gives only a few rows of output and the third column of
each row articulates clearly what index is being used with
each table.  This is easier than searching for OpenRead opcodes
in a really big query program.

Note that the feature is undocumented.  This means that it might
change in incompatible ways or go away all together in some
future release.  So you are advised not to write code that
depends on it.  Use it for debugging only.

--
D. Richard Hipp <[EMAIL PROTECTED]>

Reply via email to