tibberous Posted July 30, 2008 Share Posted July 30, 2008 If I have a table with a many to one relationship, should I add an index to speed it up? ratings -> products And products have multiple ratings. And ratings have an `Owner` field. And what would the syntax be? create index `identifer` on ... ? Thanks Link to comment https://forums.phpfreaks.com/topic/117311-should-i-add-an-index/ Share on other sites More sharing options...
JonnoTheDev Posted July 30, 2008 Share Posted July 30, 2008 Simple answer: yes If your are using joins on the products to ratings So your ratings table should have an index on productId // example ALTER TABLE ratings ADD INDEX (productId) Link to comment https://forums.phpfreaks.com/topic/117311-should-i-add-an-index/#findComment-603489 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.