1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

(Part#2) MDEV-13049 Querying INFORMATION_SCHEMA becomes slow in MariaDB 10.1

This is a 10.3 specific part of MDEV-13049.
It disables automatic sorting for
"SELECT .. FROM INFORMATION_SCHEMA.{SCHEMATA|TABLES}"
and adjusts the affected tests accordingly.
This commit is contained in:
Alexander Barkov
2017-10-31 13:00:20 +04:00
parent 835cbbcc7b
commit 5d3ed9acdd
64 changed files with 380 additions and 226 deletions

View File

@@ -3,7 +3,8 @@
CREATE TEMPORARY TABLE table_list (id INT AUTO_INCREMENT, PRIMARY KEY (id)) AS
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA='performance_schema';
WHERE TABLE_SCHEMA='performance_schema'
ORDER BY TABLE_NAME;
SELECT COUNT(*) FROM table_list INTO @table_count;
# For each table in the performance schema, attempt HANDLER...OPEN,
@@ -67,11 +68,11 @@ SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=34;
HANDLER performance_schema.mutex_instances OPEN;
ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`mutex_instances` doesn't have this option
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=33;
HANDLER performance_schema.hosts OPEN;
ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`hosts` doesn't have this option
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=32;
HANDLER performance_schema.host_cache OPEN;
ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`host_cache` doesn't have this option
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=32;
HANDLER performance_schema.hosts OPEN;
ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`hosts` doesn't have this option
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=31;
HANDLER performance_schema.file_summary_by_instance OPEN;
ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`file_summary_by_instance` doesn't have this option

View File

@@ -1,6 +1,7 @@
select TABLE_SCHEMA, lower(TABLE_NAME), TABLE_CATALOG
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
where TABLE_SCHEMA='performance_schema'
order by table_name;
TABLE_SCHEMA lower(TABLE_NAME) TABLE_CATALOG
performance_schema accounts def
performance_schema cond_instances def
@@ -33,8 +34,8 @@ performance_schema events_waits_summary_global_by_event_name def
performance_schema file_instances def
performance_schema file_summary_by_event_name def
performance_schema file_summary_by_instance def
performance_schema host_cache def
performance_schema hosts def
performance_schema host_cache def
performance_schema mutex_instances def
performance_schema objects_summary_global_by_type def
performance_schema performance_timers def
@@ -56,7 +57,8 @@ performance_schema threads def
performance_schema users def
select lower(TABLE_NAME), TABLE_TYPE, ENGINE
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
where TABLE_SCHEMA='performance_schema'
order by table_name;
lower(TABLE_NAME) TABLE_TYPE ENGINE
accounts BASE TABLE PERFORMANCE_SCHEMA
cond_instances BASE TABLE PERFORMANCE_SCHEMA
@@ -89,8 +91,8 @@ events_waits_summary_global_by_event_name BASE TABLE PERFORMANCE_SCHEMA
file_instances BASE TABLE PERFORMANCE_SCHEMA
file_summary_by_event_name BASE TABLE PERFORMANCE_SCHEMA
file_summary_by_instance BASE TABLE PERFORMANCE_SCHEMA
host_cache BASE TABLE PERFORMANCE_SCHEMA
hosts BASE TABLE PERFORMANCE_SCHEMA
host_cache BASE TABLE PERFORMANCE_SCHEMA
mutex_instances BASE TABLE PERFORMANCE_SCHEMA
objects_summary_global_by_type BASE TABLE PERFORMANCE_SCHEMA
performance_timers BASE TABLE PERFORMANCE_SCHEMA
@@ -112,7 +114,8 @@ threads BASE TABLE PERFORMANCE_SCHEMA
users BASE TABLE PERFORMANCE_SCHEMA
select lower(TABLE_NAME), VERSION, ROW_FORMAT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
where TABLE_SCHEMA='performance_schema'
order by table_name;
lower(TABLE_NAME) VERSION ROW_FORMAT
accounts 10 Fixed
cond_instances 10 Dynamic
@@ -145,8 +148,8 @@ events_waits_summary_global_by_event_name 10 Dynamic
file_instances 10 Dynamic
file_summary_by_event_name 10 Dynamic
file_summary_by_instance 10 Dynamic
host_cache 10 Dynamic
hosts 10 Fixed
host_cache 10 Dynamic
mutex_instances 10 Dynamic
objects_summary_global_by_type 10 Dynamic
performance_timers 10 Fixed
@@ -168,7 +171,8 @@ threads 10 Dynamic
users 10 Fixed
select lower(TABLE_NAME), TABLE_ROWS, AVG_ROW_LENGTH
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
where TABLE_SCHEMA='performance_schema'
order by table_name;
lower(TABLE_NAME) TABLE_ROWS AVG_ROW_LENGTH
accounts 1000 0
cond_instances 1000 0
@@ -201,8 +205,8 @@ events_waits_summary_global_by_event_name 1000 0
file_instances 1000 0
file_summary_by_event_name 1000 0
file_summary_by_instance 1000 0
host_cache 1000 0
hosts 1000 0
host_cache 1000 0
mutex_instances 1000 0
objects_summary_global_by_type 1000 0
performance_timers 5 0
@@ -224,7 +228,8 @@ threads 1000 0
users 1000 0
select lower(TABLE_NAME), DATA_LENGTH, MAX_DATA_LENGTH
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
where TABLE_SCHEMA='performance_schema'
order by table_name;
lower(TABLE_NAME) DATA_LENGTH MAX_DATA_LENGTH
accounts 0 0
cond_instances 0 0
@@ -257,8 +262,8 @@ events_waits_summary_global_by_event_name 0 0
file_instances 0 0
file_summary_by_event_name 0 0
file_summary_by_instance 0 0
host_cache 0 0
hosts 0 0
host_cache 0 0
mutex_instances 0 0
objects_summary_global_by_type 0 0
performance_timers 0 0
@@ -280,7 +285,8 @@ threads 0 0
users 0 0
select lower(TABLE_NAME), INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
where TABLE_SCHEMA='performance_schema'
order by table_name;
lower(TABLE_NAME) INDEX_LENGTH DATA_FREE AUTO_INCREMENT
accounts 0 0 NULL
cond_instances 0 0 NULL
@@ -313,8 +319,8 @@ events_waits_summary_global_by_event_name 0 0 NULL
file_instances 0 0 NULL
file_summary_by_event_name 0 0 NULL
file_summary_by_instance 0 0 NULL
host_cache 0 0 NULL
hosts 0 0 NULL
host_cache 0 0 NULL
mutex_instances 0 0 NULL
objects_summary_global_by_type 0 0 NULL
performance_timers 0 0 NULL
@@ -336,7 +342,8 @@ threads 0 0 NULL
users 0 0 NULL
select lower(TABLE_NAME), CREATE_TIME, UPDATE_TIME, CHECK_TIME
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
where TABLE_SCHEMA='performance_schema'
order by table_name;
lower(TABLE_NAME) CREATE_TIME UPDATE_TIME CHECK_TIME
accounts NULL NULL NULL
cond_instances NULL NULL NULL
@@ -369,8 +376,8 @@ events_waits_summary_global_by_event_name NULL NULL NULL
file_instances NULL NULL NULL
file_summary_by_event_name NULL NULL NULL
file_summary_by_instance NULL NULL NULL
host_cache NULL NULL NULL
hosts NULL NULL NULL
host_cache NULL NULL NULL
mutex_instances NULL NULL NULL
objects_summary_global_by_type NULL NULL NULL
performance_timers NULL NULL NULL
@@ -392,7 +399,8 @@ threads NULL NULL NULL
users NULL NULL NULL
select lower(TABLE_NAME), TABLE_COLLATION, CHECKSUM
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
where TABLE_SCHEMA='performance_schema'
order by table_name;
lower(TABLE_NAME) TABLE_COLLATION CHECKSUM
accounts utf8_general_ci NULL
cond_instances utf8_general_ci NULL
@@ -425,8 +433,8 @@ events_waits_summary_global_by_event_name utf8_general_ci NULL
file_instances utf8_general_ci NULL
file_summary_by_event_name utf8_general_ci NULL
file_summary_by_instance utf8_general_ci NULL
host_cache utf8_general_ci NULL
hosts utf8_general_ci NULL
host_cache utf8_general_ci NULL
mutex_instances utf8_general_ci NULL
objects_summary_global_by_type utf8_general_ci NULL
performance_timers utf8_general_ci NULL
@@ -448,7 +456,8 @@ threads utf8_general_ci NULL
users utf8_general_ci NULL
select lower(TABLE_NAME), TABLE_COMMENT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
where TABLE_SCHEMA='performance_schema'
order by table_name;
lower(TABLE_NAME) TABLE_COMMENT
accounts
cond_instances
@@ -481,8 +490,8 @@ events_waits_summary_global_by_event_name
file_instances
file_summary_by_event_name
file_summary_by_instance
host_cache
hosts
host_cache
mutex_instances
objects_summary_global_by_type
performance_timers

View File

@@ -21,7 +21,8 @@ declare debug integer default 0;
declare pfs_cursor CURSOR FOR
select table_name from information_schema.tables
where table_schema= 'performance_schema'
and table_name like "events_%_by_event_name%";
and table_name like "events_%_by_event_name%"
order by table_name;
declare continue handler for sqlstate '02000'
set done = 1;
select (instr_name like "wait/%") or (instr_name like "idle/%") into is_wait;