PDA

View Full Version : clarification on indexing, plz.


bazz
04-28-2008, 04:24 PM
Hi,

Just one question about indexing table columns.

MySQL 5.0 using InnoDB.

I am using foreign keys.

I wonder about indexing too many columns so; shouldn't I index both columns, that will be joined on or should I index only the column with the foreign key?

bazz

Fumigator
04-28-2008, 04:50 PM
You should use the "explain" command to give you information about what to index. This page in the MySQL manual (http://dev.mysql.com/doc/refman/5.0/en/query-speed.html) has a host of info on how to optimize tables, and the page on the Explain command (http://dev.mysql.com/doc/refman/5.0/en/using-explain.html) is very helpful as well.

bazz
04-28-2008, 07:00 PM
Thanks Fumigator, I'll read up on those again and see if I can find what I am looking for.

bazz