Hello,
I am trying to go back through all of my tables and optimize them. I have a general question here.
I have a site that allows members to add items to their favorites. The table only stores two items; user_id and item_id. When they attempt to add an item to their favorites I do a check to make sure that there is not an entry for that user_id and item_id already existing and deny it if there is.
I used this: EXPLAIN SELECT * FROM table WHERE user_id = 1
and it shows null for all fields. In a situation like this is it better to add another auto-incrementing field called fave_id and set it to index? I know it would take more space but would it speed things up?
I'd love to hear any general advice that you could give me on this matter.
Thanks a lot!