Hi, in my application, an Icon is made up of one or more layers of images:
CREATE TABLE IconLayer ( IconID INTEGER NOT NULL, Order INTEGER NOT NULL, ImageID INTEGER NOT NULL REFERENCES Image( _id ), PRIMARY KEY ( IconID, Order ) ); During runtime, I want to get the layers of my Icons: SELECT ImageID FROM IconLayer WHERE IconID=xyz ORDER BY Order Do I still need an index on the column IconID, or is the primary key sufficient, because it already contains the IconID? Is this dependant on the order of the columns in the primary key? i.e.: if no additional index is needed, would it still work, if the primary key was "PRIMARY KEY ( Order, IconID )" ? Thanks for your help! Florian _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users