Eric Minbiole wrote:
>> If I have a query:
>>
>> SELECT foo FROM bar WHERE id = 14;
>>
>> How can I see if that query is optimized to use an index, and which index
>> it's using. I thought if you did an EXPLAIN it would show that, but I'm not
>> seeing it? Maybe it's not really using an index?
>
> Use the command "EXPLAIN QUERY PLAN {your sql command}". This will give
> you a high level overview of all the tables being accessed, and which
> indices (if any) will be used for each.
>
> For a simple query like your example, SQLite will almost certainly use
> an index on "id" if one is available. You can use above to verify this.
That did exactly what I needed... and it pointed out that I *wasn't* using
an index. I didn't realize "INTEGER PRIMARY KEY" was case sensitive. Thanks
for the help.
- Scott
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users