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.