[CONJ-1142] Accessing INFORMATION_ SCHEMA STATISTICS reports a large number of checking permissions Created: 2023-11-30 Updated: 2023-12-22 Resolved: 2023-12-12 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | metadata |
| Affects Version/s: | None |
| Fix Version/s: | 3.3.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | kennyliao | Assignee: | Diego Dupin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
After running MySQL, there are 7 servers executing concurrently initially access information_schema, There are a large number of checking permissions in the schema, which takes a long time. There are 3200 files underdatabase ds SHOW FULL PROCESSLIST; Id: 827 |
| Comments |
| Comment by Vladislav Vaintroub [ 2023-11-30 ] | ||||||||||||||||
|
I guess you need to provide (anonymized) DDL for all tables in the database. | ||||||||||||||||
| Comment by kennyliao [ 2023-12-01 ] | ||||||||||||||||
|
This situation is bound to occur every time the mysqld is restarted,and There are a large number of sub tables in the database ds. The environment built is a center with 6 distributed nodes, capturing slow queries for more than 0.2 seconds. None of the center nodes are present (Center Server first run), while the other 6 distributed nodes are all very slow(Concurrent Access Center Server). Can we avoid it by optimizing what parameters? Or can upgrading the mariadb version solve this problem? CREATE TABLE `adm_history` ( CREATE TABLE `c_pic` ( | ||||||||||||||||
| Comment by Vladislav Vaintroub [ 2023-12-01 ] | ||||||||||||||||
|
kennyliao, is this query coming from MariaDB's JDBC driver? DatabaseMetadata.getPrimaryKeys()? Can you execute it yourself, replacing A.TABLE_NAME LIKE 'adm_history' AND B.TABLE_NAME LIKE 'adm_history' with (basically replacing LIKE with '=') I believe there is a bug in JDBC driver logic, documentation indicates there should not be wildcard search here, so no "LIKE". It possibly has an implication on how many tables are checked (and you got many) | ||||||||||||||||
| Comment by kennyliao [ 2023-12-02 ] | ||||||||||||||||
|
Vladislav Vaintroub,after ‘like’ replace to ‘=’ ,The distributed nodes has been shortened from 5 minutes to 2 minutes, and the effect is very obvious. | ||||||||||||||||
| Comment by Diego Dupin [ 2023-12-02 ] | ||||||||||||||||
|
kennyliao There was indeed a problem in mariadb connector. After discussing it with wlad, consist of 2 parts:
(correction done connector side in benchmark result show huge improvement: 12251.3 operations per second in place of 11.5 in testing environment, using 10k tables Correction is for now only as a snapshot version for testing, until 3.3.2 release.
| ||||||||||||||||
| Comment by Vladislav Vaintroub [ 2023-12-12 ] | ||||||||||||||||
|
I moved it to Connector/J , as the fix is done inside the connector. I do not know about the blocker, only that it worked like this for a long time, or even since inception of the Connector. It is likely that only not very usual setups with many thousands of tables are affected | ||||||||||||||||
| Comment by Vladislav Vaintroub [ 2023-12-22 ] | ||||||||||||||||
|
That was released some days ago in Connector/J 3.3.2 ( https://mariadb.com/kb/en/mariadb-connector-j-3-3-2-release-notes/ ) |