Why does the Wordpress database schema not use foreign keys? [closed] Why does the Wordpress database schema not use foreign keys? [closed] wordpress wordpress

Why does the Wordpress database schema not use foreign keys? [closed]


WordPress uses MyISAM, because of more functionality and better performance, but MyISAM did not support foreign keys. It was a trade off.


Foreign keys are just constraints - they make it easier to preserve integrity of the data, but are not required to correlate the tables. Wordpress uses MySQL and MySQL can use many "engines" for storing the tables, but AFAIK only one of them (InnoDB) supports foreign keys. Wordpress probably decided not to use it for performance reasons.