Hi,

the following simple query is very slow:
  SELECT title FROM t1 WHERE ipnode='VZ' ORDER BY author;

The database is about 250 MB in size and the table the query is run against
has 12 cols and 120,000 rows.
Every col has an index.
The above query returns about 80% of the records.
As soon as the ORDER BY statement is left away, the query ist fast.

If i interpret the output of "explain" in the sqlite commandline tool
correctly, only one index - the one for the column "ipnode" - is used.
No index is used for sorting!!

Usually the above table would be joined with another one which makes things
even worse.

Other tests produced the same results:
Wether there is an ORDER BY clause or multiple columns are referenced in the
WHERE clause - there will allways be only one index used.

What am i doing wrong?
Is it true that sqlite can only use one index per table in a query?
How can i get sqlite to use more than one index per table at a time?

cheers
Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to