Adding a row with a single attribute to the Indexes
list is equivalent to selecting Indexed
for that attribute: It creates an index for the attribute to speed up searches in query statements.
The Indexes
list is meant for compound indexes. Compound indexes are useful when you know that you will be searching for values of these attributes combined in the WHERE
clause of a query:
SELECT * FROM customer WHERE surname = "Doe" AND firstname = "Joe";
This statement could make use of a compound index surname, firstname
. That index would also be useful if you just search for surname
, but not if you only search for firstname
. Think of the index as if it were a phone book: It is sorted by surname first, then by first name. So the order of attributes is important.
In your case you should go for the single indexes first (that is, select Indexed
for the attributes you like to search for). The compound index you showed could never be used if you just search for babyId
, for example.