List:General Discussion« Previous MessageNext Message »
From:SGreen Date:October 13 2004 4:03pm
Subject:Re: InnoDB and foreign keys
View as plain text  
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" <seppi@stripped> 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/mysql?unsub=1
> 

Thread
InnoDB and foreign keysUlrich Seppi13 Oct
  • Re: InnoDB and foreign keysSGreen13 Oct
  • Re: InnoDB and foreign keysMartijn Tonies13 Oct
    • AW: InnoDB and foreign keysUlrich Seppi13 Oct
      • Re: AW: InnoDB and foreign keysSGreen13 Oct
      • Re: AW: InnoDB and foreign keysJohn McCaskey13 Oct
    • Re: InnoDB and foreign keysGary Richardson14 Oct
  • Re: InnoDB and foreign keysJeff Smelser13 Oct