I am not certain that Foreign Keys (FKs) are even considered when 
evaluating a SELECT statement.  I know that the indexes that the FKs point 
to in either table play a major role in determining the execution plan but 
I don't think that the FKs actually participate in SELECT queries.

Now, does having those tables so well-indexed play a role in improving 
query performance? Probably, but you should use the EXPLAIN command to 
find out for sure:

http://dev.mysql.com/doc/mysql/en/EXPLAIN.html

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

"Ulrich Seppi" <[EMAIL PROTECTED]> wrote on 10/13/2004 11:33:09 AM:

> Hello people,
> does anybody know if Foreign keys increase the performance of select 
querys?
> example.
> DB1 has only INNODB tables.
> DB2 has the same structure as DB1 with all possible foreign keys.
> 
> is the same query faster on DB1 or DB2?
> regards
> Uli
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> 

Reply via email to