[MDEV-20968] Possible performance issue when querying DB metadata (constraints, fkeys) Created: 2019-11-04 Updated: 2020-09-29 Resolved: 2019-12-24 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Information Schema |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Miroslav Stanik | Assignee: | Unassigned |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | need_feedback | ||
| Description |
|
When running queries to load constraints, there is a possible performance issue. it takes a long time to execute and load data from system tables: How to reproduce:
it takes ages to finish. procs to generate env:
|
| Comments |
| Comment by Elena Stepanova [ 2019-11-05 ] | |
|
Which version is it about? | |
| Comment by Miroslav Stanik [ 2019-11-05 ] | |
|
version 10.4.8 but reproducible also with previous versions | |
| Comment by Elena Stepanova [ 2019-11-18 ] | |
|
So, are you comparing the performance with some other version or server, where it works considerably faster? "Takes a long time" is subjective matter. Opening 100,000 tables surely won't be fast, and how long exactly it takes depends a lot on the environment. | |
| Comment by Dominic Watson [ 2020-09-29 ] | |
|
While it is subjective, it is problematic. On a MariaDB RDS server with ~9000 tables, the following query was sometimes taking over 20m:
This query was running as part of Percona Online Schema Change script to determine how to handle foreign key changes. We've upgraded hardware and that has improved the situation, but the query is still taking over 60 seconds. There is a resolved ticket for MySQL on this subject that might be useful: https://bugs.mysql.com/bug.php?id=98238 We are on 10.3.8. |