USA/Canada - Toll Free: +1-866-221-0634
USA - From abroad: +1-208-327-6494
USA/Canada - Subscription Renewals: +1-866-221-0634
Latin America: +1 512 535 7751
UK: +44 845 399 1124
Ireland: +353 1 6919191
Germany: +49 89 420 95 98 95
France: +33 1 70 61 48 95
Sweden: +46 730 207 871
Benelux: +31 6 25003558
Italy: +39 06-99268193
Israel: +31 6 25003558
Spain & Portugal: + 34 933905461
Other EMEA countries: +353 1 6919191
Australia/NZ: +61 2 42314328
Asia Pacific: +81 3 5843 1140
Newsletters older than 6 months may have links that are out of date. Please use the Search to check for updated links.
How (where) does Innodb store information about foreign keys?
Foreign keys are stored in InnoDB tables SYS_FOREIGN and SYS_FOREIGN_COLS.
InnoDB stores foreign key constraints as separate objects. When we take a table to use, InnoDB searches all foreign key constraints for that table as well as the ones that reference that table (note above that we have secondary indexes on table names). It caches the foreign key information to the data dictionary cache in main memory. Thus, foreign key info is very quickly available for any operation on the table.

