[phpMyAdmin Git] [phpmyadmin/phpmyadmin] e4d9a1: Fix for handle large number of tables in a single database (more than 10k)

Nicolas Hervouet github at pico12.fr
Fri Mar 24 15:57:00 CET 2023


Branch: refs/heads/QA_5_2
Home: https://github.com/phpmyadmin/phpmyadmin
Commit: e4d9a1a66ab0b036d7925167a6259ab96d251426
https://github.com/phpmyadmin/phpmyadmin/commit/e4d9a1a66ab0b036d7925167a6259ab96d251426
Author: Nicolas Hervouet <github at pico12.fr>
Date: 2023-03-24 (Fri, 03 March 2023) -03:00

Changed paths: 
M libraries/classes/DatabaseInterface.php
M libraries/classes/Util.php

Log Message:
-----------
Fix for handle large number of tables in a single database (more than 10k)

getTablesFull was taking too much time, because MySQL do not have a real table where it stores all tables information.
So when it runs a query like select * from information_schema.TABLES ORDER BY Name limit 250 offset 0, MySQL has to read information about all tables to build his in memory table, then sort it by name, and then return 250 first tables.
But reading information about one table takes time, and that's why the query is very slow when you have a lot of tables.
Note that the problem is the same with 'SHOW TABLE STATUS'.

So, in order to speed up this query, we have to limit it to a small list of tables, as it, MySQL has to read table information only for few tables.
Note that SHOW TABLES is not that long, even with a large amount of tables.

The idea here is to use the result of SHOW TABLES query, to apply paging on this table list, and then to run the query on information_schema.TABLES only on tables we want.

Signed-off-by: Nicolas Hervouet <github at pico12.fr>

Commit: 64aa5fc7b9ff859b5c90f20b81937e85264e9238
https://github.com/phpmyadmin/phpmyadmin/commit/64aa5fc7b9ff859b5c90f20b81937e85264e9238
Author: Maurício Meneghini Fauth <mauricio at fauth.dev>
Date: 2023-03-24 (Fri, 03 March 2023) -03:00

Changed paths: 
M libraries/classes/DatabaseInterface.php
M libraries/classes/Util.php

Log Message:
-----------
Merge pull request #17718 from PicoI2/handle-large-number-of-tables-in-database-qa52

Fix for handle large number of tables in a single database (based on QA_5_2)



More information about the Git mailing list