-----Original Message-----
Subject: Re: [sqlite] SQLite performance woe

I maybe confused but indices sound similar to what I understand primary
keys do, I already have primary keys on each table.  Unless I'm mistaken
as to what primary keys are?  From your explanation I guess I'm slightly
confused about the difference in primary keys and indices and that I
need to implement indices to speed up my queries. Are there any general
guidelines for creating indices?  Is it as simple as creating an indice
per primary key in a table?  

How do I interpret the output from EXPLAIN QUERY PLAN?

-----

Sorry, emails crossed.

Regarding "explaining EXPLAIN":

I'm an anti-expert here, and the author writes:

   "The output from EXPLAIN and EXPLAIN QUERY PLAN is intended for
interactive analysis and troubleshooting only. The details of the output
format are subject to change from one release of SQLite to the next.
Applications should not use EXPLAIN or EXPLAIN QUERY PLAN since their
behavior is undocumented, unspecified, and variable."
   (above is from:  http://www.sqlite.org/lang_explain.html )

Nonetheless -- 
   If I run EXPLAIN QUERY PLAN on a query and get an output such as the
following, then I know that my query is using the index named "myIndex"
in accessing table "client_logs."

0       1       TABLE clients
1       0       TABLE client_logs AS cl WITH INDEX myIndex
0       0       TABLE lastContact

You may want to post here the commands you use to create your tables
(schema).

Since sqlite shows "benign neglect" to most data type specifications, I
wondered if it's possible that your definitions of primary keys are not
being honored?

You may also be interested in:
http://www.sqlite.org/lang_createindex.html
http://www.sqlite.org/cvstrac/wiki?p=PerformanceTuning
http://www.sqlite.org/lang_createtable.html
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to