1# 2# Bug#12427262 : 60961: SHOW TABLES VERY SLOW WHEN NOT IN SYSTEM DISK CACHE. 3# 4create database show_table_lw_db; 5use show_table_lw_db; 6create table t1 (c1 int); 7create table t2 (c1 int); 8create table t3 (c1 int); 9create table t4 (c1 int); 10create table t5 (c1 int); 11create table t6 (c1 int); 12create table t7 (c1 int); 13create table t8 (c1 int); 14create table t9 (c1 int); 15create table t10 (c1 int); 16# Query PS to know initial read count for frm file. 17select Sum(ALL(COUNT_READ)) from performance_schema.file_summary_by_instance where FILE_NAME 18like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/file/sql/FRM' 19into @count_read_before; 20show tables; 21Tables_in_show_table_lw_db 22t1 23t10 24t2 25t3 26t4 27t5 28t6 29t7 30t8 31t9 32# Query PS to know read count for frm file after above query. It should 33# not be changed as FRM file will not be opened for above query. 34select Sum(ALL(COUNT_READ)) from performance_schema.file_summary_by_instance where FILE_NAME 35like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/file/sql/FRM' 36into @count_read_after; 37select @count_read_after-@count_read_before; 38@count_read_after-@count_read_before 390.000000000000000000000000000000 40show full tables; 41Tables_in_show_table_lw_db Table_type 42t1 BASE TABLE 43t10 BASE TABLE 44t2 BASE TABLE 45t3 BASE TABLE 46t4 BASE TABLE 47t5 BASE TABLE 48t6 BASE TABLE 49t7 BASE TABLE 50t8 BASE TABLE 51t9 BASE TABLE 52# Query PS to know read count for frm file after above query. COUNT_READ 53# will be incremented by 1 as FRM file will be opened for above query. 54select Sum(ALL(COUNT_READ)) from performance_schema.file_summary_by_instance where FILE_NAME 55like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/file/sql/FRM' 56into @count_read_after; 57select @count_read_after-@count_read_before; 58@count_read_after-@count_read_before 5910.000000000000000000000000000000 60drop table t1; 61drop database show_table_lw_db; 62