Hi

I understand about Primary keys and Unique keys attributed to their own field. 
Is there a need to have other fields indexed, for faster searching? Eg. a table 
containing your favourite music. Say you have 9 Beethoven symphonies (one row 
in the table for each), 14 Bach partitas and 100 Haydn symphonies, and you want 
to select the Bach ones.
You have a table called AllMusic containing columns called Composer, 
NameOfPiece, YearComposed, etc.

SELECT * FROM AllMusic_tbl WHERE Composer = 'Bach' ORDER BY YearComposed

I thought the select would be quicker if the AllMusic table had keys or indexes 
on a couple of important columns, eg. in this case Composer and YearComposed. 
Plainly the indexes would not be unique - there would be multiple examples of 
Bach and Beethoven in any Composer field and many pieces composed in any single 
year.

Does sqlite need such indexes, and if so what is the syntax at CreateTable time?

Thanks in advance.

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

Reply via email to