Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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@pico12.fr>
- Loading branch information