Why does the WordPress database schema not use foreign keys?

Today i check the tables of the wordpress database but i can’t find foreign keys to relate tables , can anybody tell me why wordpress don’t have foreign keys ?

Related posts

Leave a Reply

2 comments

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

  2. 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.