So if I have an sql query like these:
SELECT title, document FROM docs WHERE id = "1" and type = "2"
SELECT title FROM docs WHERE id = "1"
SELECT title FROM docs WHERE member = "foo"
to maximize speed for the first one i. would I have to index only the keys (id and type together? seperate?) ii. would I also have to index title and document (together,separate)
same type of questions apply for the second one, and for the third query i. would I have to index only member?
IM just trying to understand mysql retrieval and indexing.
You need 2 indexes
id, typemakesidredundant