-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix MariaDB list columns performance #6202
Conversation
Just to add more notes: this is especially noticeable in local development environments where you may have a lot of databases with lots of tables from various projects - as the unoptimized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for picking this PR up so late.
Nothing to be sorry about! Thank you for all your work on doctrine! |
3a01396
to
82d8266
Compare
This should be ready now. Followup pull requests:
|
* 3.7.x: Fix MariaDB list columns performance (#6202)
| Q | A |------------- | ----------- | Type | improvement | Fixed issues | #6202 (comment) #### Summary Deprecates `AbstractMySQLPlatform::getColumnTypeSQLSnippets()` ~~Needs to be rebased after #6202 got merged upstream.~~ Done. --------- Co-authored-by: Alexander M. Turek <me@derrabus.de>
* 3.8.x: Deprecate AbstractMySQLPlatform::getColumnTypeSQLSnippets() (doctrine#6213) Fix MariaDB list columns performance (doctrine#6202)
* 3.8.x: Enable skipping locked rows in QueryBuilder Fix coding standard violation Remove unused unit test fixtures Add Oracle v23 to CI testing (doctrine#6217) Extend `AbstractMySQLPlatform::getColumnTypeSQLSnippets()` deprecation layer (doctrine#6215) Deprecate AbstractMySQLPlatform::getColumnTypeSQLSnippets() (doctrine#6213) Fix MariaDB list columns performance (doctrine#6202)
* 3.8.x: Enable skipping locked rows in QueryBuilder Fix coding standard violation Remove unused unit test fixtures Add Oracle v23 to CI testing (doctrine#6217) Extend `AbstractMySQLPlatform::getColumnTypeSQLSnippets()` deprecation layer (doctrine#6215) Deprecate AbstractMySQLPlatform::getColumnTypeSQLSnippets() (doctrine#6213) Fix MariaDB list columns performance (doctrine#6202)
| Q | A |------------- | ----------- | Type | feature | Fixed issues | #6202 (comment) #### Summary Removes `AbstractMySQLPlatform::getColumnTypeSQLSnippets()` Needs to be rebased after #6202 and #6213 got merged upstream.
| Q | A |------------- | ----------- | Type | bug | Fixed issues | contao/contao#6409 #### Summary Starting with version 3.7.0 we noticed that the `listTableColumns()` method got very slow on some systems, our migrate command went from taking around 2 seconds with version 3.6 to 260 seconds with version3.7. This is due to the `LEFT JOIN information_schema.CHECK_CONSTRAINTS` not getting optimized by MariaDB which causes the database server to scan every table of every database. This pull request fixes that by using a subquery that is limited by `WHERE CONSTRAINT_SCHEMA = $databaseName`. This brings the performance back to where it was with version 3.6.
Doctrine DBAL 3.7.0 introduced a performance issue [1] which has been already fixed by the Doctrine Team [2]. This change updates the `doctrine/dbal` composer constraint to ensure that this performance issue is gone. Note: The monorepo composer.lock already containted the 3.7.2 bugfis release, therefore this has not been detected in casual core development. This update is to mitigate the performance issue at all costs for TYPO3 users. As a sideeffect, this should put `composerInstallMin` nightly function tests on speed again. Used command(s): > composer require --no-update --no-install \ -d typo3/sysext/redirects \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update --no-install \ -d typo3/sysext/core \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update --no-install \ -d typo3/sysext/install \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update \ "doctrine/dbal":"^3.7.2" ; \ composer update --lock [1] contao/contao#6409 [2] doctrine/dbal#6202 Resolves: #102830 Releases: main, 12.4 Change-Id: If8b09f9556f11cc0fda4690f81343fc6c5d5e476 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82449 Reviewed-by: Benni Mack <benni@typo3.org> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Tested-by: Stefan Bürk <stefan@buerk.tech> Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de> Tested-by: core-ci <typo3@b13.com> Reviewed-by: Garvin Hicking <gh@faktor-e.de> Tested-by: Benni Mack <benni@typo3.org> Tested-by: Garvin Hicking <gh@faktor-e.de> Tested-by: Oliver Klee <typo3-coding@oliverklee.de>
Doctrine DBAL 3.7.0 introduced a performance issue [1] which has been already fixed by the Doctrine Team [2]. This change updates the `doctrine/dbal` composer constraint to ensure that this performance issue is gone. Note: The monorepo composer.lock already containted the 3.7.2 bugfis release, therefore this has not been detected in casual core development. This update is to mitigate the performance issue at all costs for TYPO3 users. As a sideeffect, this should put `composerInstallMin` nightly function tests on speed again. Used command(s): > composer require --no-update --no-install \ -d typo3/sysext/redirects \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update --no-install \ -d typo3/sysext/core \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update --no-install \ -d typo3/sysext/install \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update \ "doctrine/dbal":"^3.7.2" ; \ composer update --lock [1] contao/contao#6409 [2] doctrine/dbal#6202 Resolves: #102830 Releases: main, 12.4 Change-Id: If8b09f9556f11cc0fda4690f81343fc6c5d5e476 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82448 Tested-by: Markus Klein <markus.klein@typo3.org> Tested-by: Garvin Hicking <gh@faktor-e.de> Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Tested-by: core-ci <typo3@b13.com> Reviewed-by: Benni Mack <benni@typo3.org> Reviewed-by: Markus Klein <markus.klein@typo3.org> Tested-by: Oliver Klee <typo3-coding@oliverklee.de> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Garvin Hicking <gh@faktor-e.de> Tested-by: Stefan Bürk <stefan@buerk.tech>
Doctrine DBAL 3.7.0 introduced a performance issue [1] which has been already fixed by the Doctrine Team [2]. This change updates the `doctrine/dbal` composer constraint to ensure that this performance issue is gone. Note: The monorepo composer.lock already containted the 3.7.2 bugfis release, therefore this has not been detected in casual core development. This update is to mitigate the performance issue at all costs for TYPO3 users. As a sideeffect, this should put `composerInstallMin` nightly function tests on speed again. Used command(s): > composer require --no-update --no-install \ -d typo3/sysext/redirects \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update --no-install \ -d typo3/sysext/core \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update --no-install \ -d typo3/sysext/install \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update \ "doctrine/dbal":"^3.7.2" ; \ composer update --lock [1] contao/contao#6409 [2] doctrine/dbal#6202 Resolves: #102830 Releases: main, 12.4 Change-Id: If8b09f9556f11cc0fda4690f81343fc6c5d5e476 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82449 Reviewed-by: Benni Mack <benni@typo3.org> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Tested-by: Stefan Bürk <stefan@buerk.tech> Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de> Tested-by: core-ci <typo3@b13.com> Reviewed-by: Garvin Hicking <gh@faktor-e.de> Tested-by: Benni Mack <benni@typo3.org> Tested-by: Garvin Hicking <gh@faktor-e.de> Tested-by: Oliver Klee <typo3-coding@oliverklee.de>
Doctrine DBAL 3.7.0 introduced a performance issue [1] which has been already fixed by the Doctrine Team [2]. This change updates the `doctrine/dbal` composer constraint to ensure that this performance issue is gone. Note: The monorepo composer.lock already containted the 3.7.2 bugfis release, therefore this has not been detected in casual core development. This update is to mitigate the performance issue at all costs for TYPO3 users. As a sideeffect, this should put `composerInstallMin` nightly function tests on speed again. Used command(s): > composer require --no-update --no-install \ -d typo3/sysext/redirects \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update --no-install \ -d typo3/sysext/core \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update --no-install \ -d typo3/sysext/install \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update \ "doctrine/dbal":"^3.7.2" ; \ composer update --lock [1] contao/contao#6409 [2] doctrine/dbal#6202 Resolves: #102830 Releases: main, 12.4 Change-Id: If8b09f9556f11cc0fda4690f81343fc6c5d5e476 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82449 Reviewed-by: Benni Mack <benni@typo3.org> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Tested-by: Stefan Bürk <stefan@buerk.tech> Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de> Tested-by: core-ci <typo3@b13.com> Reviewed-by: Garvin Hicking <gh@faktor-e.de> Tested-by: Benni Mack <benni@typo3.org> Tested-by: Garvin Hicking <gh@faktor-e.de> Tested-by: Oliver Klee <typo3-coding@oliverklee.de>
Doctrine DBAL 3.7.0 introduced a performance issue [1] which has been already fixed by the Doctrine Team [2]. This change updates the `doctrine/dbal` composer constraint to ensure that this performance issue is gone. Note: The monorepo composer.lock already containted the 3.7.2 bugfis release, therefore this has not been detected in casual core development. This update is to mitigate the performance issue at all costs for TYPO3 users. As a sideeffect, this should put `composerInstallMin` nightly function tests on speed again. Used command(s): > composer require --no-update --no-install \ -d typo3/sysext/redirects \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update --no-install \ -d typo3/sysext/core \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update --no-install \ -d typo3/sysext/install \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update \ "doctrine/dbal":"^3.7.2" ; \ composer update --lock [1] contao/contao#6409 [2] doctrine/dbal#6202 Resolves: #102830 Releases: main, 12.4 Change-Id: If8b09f9556f11cc0fda4690f81343fc6c5d5e476 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82449 Reviewed-by: Benni Mack <benni@typo3.org> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Tested-by: Stefan Bürk <stefan@buerk.tech> Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de> Tested-by: core-ci <typo3@b13.com> Reviewed-by: Garvin Hicking <gh@faktor-e.de> Tested-by: Benni Mack <benni@typo3.org> Tested-by: Garvin Hicking <gh@faktor-e.de> Tested-by: Oliver Klee <typo3-coding@oliverklee.de>
Doctrine DBAL 3.7.0 introduced a performance issue [1] which has been already fixed by the Doctrine Team [2]. This change updates the `doctrine/dbal` composer constraint to ensure that this performance issue is gone. Note: The monorepo composer.lock already containted the 3.7.2 bugfis release, therefore this has not been detected in casual core development. This update is to mitigate the performance issue at all costs for TYPO3 users. As a sideeffect, this should put `composerInstallMin` nightly function tests on speed again. Used command(s): > composer require --no-update --no-install \ -d typo3/sysext/redirects \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update --no-install \ -d typo3/sysext/core \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update --no-install \ -d typo3/sysext/install \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update \ "doctrine/dbal":"^3.7.2" ; \ composer update --lock [1] contao/contao#6409 [2] doctrine/dbal#6202 Resolves: #102830 Releases: main, 12.4 Change-Id: If8b09f9556f11cc0fda4690f81343fc6c5d5e476 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82448 Tested-by: Markus Klein <markus.klein@typo3.org> Tested-by: Garvin Hicking <gh@faktor-e.de> Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Tested-by: core-ci <typo3@b13.com> Reviewed-by: Benni Mack <benni@typo3.org> Reviewed-by: Markus Klein <markus.klein@typo3.org> Tested-by: Oliver Klee <typo3-coding@oliverklee.de> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Garvin Hicking <gh@faktor-e.de> Tested-by: Stefan Bürk <stefan@buerk.tech>
Doctrine DBAL 3.7.0 introduced a performance issue [1] which has been already fixed by the Doctrine Team [2]. This change updates the `doctrine/dbal` composer constraint to ensure that this performance issue is gone. Note: The monorepo composer.lock already containted the 3.7.2 bugfis release, therefore this has not been detected in casual core development. This update is to mitigate the performance issue at all costs for TYPO3 users. As a sideeffect, this should put `composerInstallMin` nightly function tests on speed again. Used command(s): > composer require --no-update --no-install \ -d typo3/sysext/redirects \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update --no-install \ -d typo3/sysext/core \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update --no-install \ -d typo3/sysext/install \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update \ "doctrine/dbal":"^3.7.2" ; \ composer update --lock [1] contao/contao#6409 [2] doctrine/dbal#6202 Resolves: #102830 Releases: main, 12.4 Change-Id: If8b09f9556f11cc0fda4690f81343fc6c5d5e476 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82448 Tested-by: Markus Klein <markus.klein@typo3.org> Tested-by: Garvin Hicking <gh@faktor-e.de> Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Tested-by: core-ci <typo3@b13.com> Reviewed-by: Benni Mack <benni@typo3.org> Reviewed-by: Markus Klein <markus.klein@typo3.org> Tested-by: Oliver Klee <typo3-coding@oliverklee.de> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Garvin Hicking <gh@faktor-e.de> Tested-by: Stefan Bürk <stefan@buerk.tech>
Doctrine DBAL 3.7.0 introduced a performance issue [1] which has been already fixed by the Doctrine Team [2]. This change updates the `doctrine/dbal` composer constraint to ensure that this performance issue is gone. Note: The monorepo composer.lock already containted the 3.7.2 bugfis release, therefore this has not been detected in casual core development. This update is to mitigate the performance issue at all costs for TYPO3 users. As a sideeffect, this should put `composerInstallMin` nightly function tests on speed again. Used command(s): > composer require --no-update --no-install \ -d typo3/sysext/redirects \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update --no-install \ -d typo3/sysext/core \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update --no-install \ -d typo3/sysext/install \ "doctrine/dbal":"^3.7.2" ; \ composer require --no-update \ "doctrine/dbal":"^3.7.2" ; \ composer update --lock [1] contao/contao#6409 [2] doctrine/dbal#6202 Resolves: #102830 Releases: main, 12.4 Change-Id: If8b09f9556f11cc0fda4690f81343fc6c5d5e476 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82448 Tested-by: Markus Klein <markus.klein@typo3.org> Tested-by: Garvin Hicking <gh@faktor-e.de> Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Tested-by: core-ci <typo3@b13.com> Reviewed-by: Benni Mack <benni@typo3.org> Reviewed-by: Markus Klein <markus.klein@typo3.org> Tested-by: Oliver Klee <typo3-coding@oliverklee.de> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Garvin Hicking <gh@faktor-e.de> Tested-by: Stefan Bürk <stefan@buerk.tech>
Summary
Starting with version 3.7.0 we noticed that the
listTableColumns()
method got very slow on some systems, our migrate command went from taking around 2 seconds with version 3.6 to 260 seconds with version3.7.This is due to the
LEFT JOIN information_schema.CHECK_CONSTRAINTS
not getting optimized by MariaDB which causes the database server to scan every table of every database.This pull request fixes that by using a subquery that is limited by
WHERE CONSTRAINT_SCHEMA = $databaseName
. This brings the performance back to where it was with version 3.6.