Link to home
Start Free TrialLog in
Avatar of Robert Granlund
Robert GranlundFlag for United States of America

asked on

MySQL Index's

MySQL Database.  How many INDEX's should a table have?  What indexs should they be? Primary, Foreign?  What is the best setup?
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

>>How many INDEX's should a table have?

As many as it needs.  Indexes are based on usage.  You need to look at how the applications use the data and created indexes to benefit the queries.

OVER INDEXING is almost just as bad as under indexing.

>>What indexs should they be? Primary, Foreign?

A table can only have one primary key.  Foreign keys are based on the tables relationships so as many as you need.

>>What is the best setup?

It is based on the applications
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial