Quick question, SQLites,

CREATE TABLE test (col1 text, col2 text, col3 text);
CREATE INDEX tindex ON test (col1, col2, col3);

explain query plan
SELECT * FROM test WHERE col1 = 'a' AND col3 = 'c';

The above returns:
SEARCH TABLE test USING COVERING INDEX tindex (col1=?) (~2 rows)


Which of the following is happening:
1. It's actually only using it as an "index" for the col1 check, and then just 
using the fact that, somewhere, it contains the rest of the data for the query 
inside the index, which is, in theory, faster than table scanning the actual 
table for the results, but you're getting no search performance gain out of 
anything other than the col1 part of the index.
2. It's actually somehow using it as an optimized index over both col1 and col3 
conditions, but only saying col1 in the explain.
3. Other..?

Thanks!
-David

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to