On 8/30/2013 12:22 PM, Doug Nebeker wrote:
CREATE UNIQUE INDEX Ind_DevProps_CompIDPropID on DevProps (CompID, PropID);

When I check the query plan for this statement:

SELECT CompID FROM DevProps WHERE PropID=33

it looks like it will be doing a table scan.  Why is that?

Imagine that you have a phone book, sorted by last name then first name. Using this book, you can easily find all Smiths, and all John Smiths, but it's not helpful in finding all people named John.

The order of columns in the index matters.
--
Igor Tandetnik

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

Reply via email to