[DBAL-1308] MySQL getListTableForeignKeysSQL Slow for MariaDB Created: 30/Sep/15  Updated: 30/Sep/15

Status: Open
Project: Doctrine DBAL
Component/s: Platforms
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Joe Meyer Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: mariadb, mysql



It appears that MySQL and MariaDB build different query plans for the getListTableForeignKeys() function (see https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php#L183-L198) . MariaDB ends up doing a table scan of the tables instead of using the constraint (possibly because it doesn't exist?). This takes a decent amount of time every time it's run, and causes PHP timeouts when it has to check numerous tables.

See https://github.com/concrete5/concrete5/issues/2994 for more discussion and query plan results.

Generated at Mon Oct 05 11:06:59 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.