create database explain_test_db; use explain_test_db; create table explain_test_table(c int) engine = XENGINE; create procedure explain_test_proc() BEGIN select * from explain_test_table; END // truncate table performance_schema.events_statements_summary_by_program; call explain_test_proc(); c ==================================================================== Testing index for columns OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME ==================================================================== ############ Explain for Query #################################### explain select COUNT_STAR from performance_schema.events_statements_summary_by_program where OBJECT_TYPE = "impossible"; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE events_statements_summary_by_program NULL ref PRIMARY PRIMARY 1 const # 100.00 Using where ############ Explain for Query #################################### explain select COUNT_STAR from performance_schema.events_statements_summary_by_program where OBJECT_TYPE > "impossible"; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE events_statements_summary_by_program NULL ALL PRIMARY NULL NULL NULL # 33.33 Using where ############ Explain for Query #################################### explain select COUNT_STAR from performance_schema.events_statements_summary_by_program where OBJECT_TYPE < "2"; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE events_statements_summary_by_program NULL ALL PRIMARY NULL NULL NULL # 33.33 Using where ############ Explain for Query #################################### explain select COUNT_STAR from performance_schema.events_statements_summary_by_program where OBJECT_TYPE = "PROCEDURE"; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE events_statements_summary_by_program NULL ref PRIMARY PRIMARY 1 const # 100.00 Using where ############ Explain for Query #################################### explain select COUNT_STAR from performance_schema.events_statements_summary_by_program where OBJECT_TYPE = "impossible" and OBJECT_SCHEMA = "impossible"; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE events_statements_summary_by_program NULL ref PRIMARY PRIMARY 259 const,const # 100.00 Using where ############ Explain for Query #################################### explain select COUNT_STAR from performance_schema.events_statements_summary_by_program where OBJECT_TYPE = "PROCEDURE" and OBJECT_SCHEMA = "impossible"; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE events_statements_summary_by_program NULL ref PRIMARY PRIMARY 259 const,const # 100.00 Using where ############ Explain for Query #################################### explain select COUNT_STAR from performance_schema.events_statements_summary_by_program where OBJECT_TYPE = "PROCEDURE" and OBJECT_SCHEMA > "impossible"; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE events_statements_summary_by_program NULL ref PRIMARY PRIMARY 1 const # 33.33 Using where ############ Explain for Query #################################### explain select COUNT_STAR from performance_schema.events_statements_summary_by_program where OBJECT_TYPE = "PROCEDURE" and OBJECT_SCHEMA < "2"; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE events_statements_summary_by_program NULL ref PRIMARY PRIMARY 1 const # 33.33 Using where ############ Explain for Query #################################### explain select COUNT_STAR from performance_schema.events_statements_summary_by_program where OBJECT_TYPE = "PROCEDURE" and OBJECT_SCHEMA = "explain_test_db"; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE events_statements_summary_by_program NULL ref PRIMARY PRIMARY 259 const,const # 100.00 Using where ############ Explain for Query #################################### explain select COUNT_STAR from performance_schema.events_statements_summary_by_program where OBJECT_TYPE = "impossible" and OBJECT_SCHEMA = "impossible" and OBJECT_NAME = "impossible"; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL # NULL no matching row in const table ############ Explain for Query #################################### explain select COUNT_STAR from performance_schema.events_statements_summary_by_program where OBJECT_TYPE = "PROCEDURE" and OBJECT_SCHEMA = "explain_test_db" and OBJECT_NAME = "impossible"; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL # NULL no matching row in const table ############ Explain for Query #################################### explain select COUNT_STAR from performance_schema.events_statements_summary_by_program where OBJECT_TYPE = "PROCEDURE" and OBJECT_SCHEMA = "explain_test_db" and OBJECT_NAME > "impossible"; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE events_statements_summary_by_program NULL ref PRIMARY PRIMARY 259 const,const # 33.33 Using where ############ Explain for Query #################################### explain select COUNT_STAR from performance_schema.events_statements_summary_by_program where OBJECT_TYPE = "PROCEDURE" and OBJECT_SCHEMA = "explain_test_db" and OBJECT_NAME < "2"; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE events_statements_summary_by_program NULL ref PRIMARY PRIMARY 259 const,const # 33.33 Using where ############ Explain for Query #################################### explain select COUNT_STAR from performance_schema.events_statements_summary_by_program where OBJECT_TYPE = "PROCEDURE" and OBJECT_SCHEMA = "explain_test_db" and OBJECT_NAME = "explain_test_proc"; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE events_statements_summary_by_program NULL const PRIMARY PRIMARY 517 const,const,const # 100.00 NULL ############# Explain End ######################################### flush status; select COUNT_STAR from performance_schema.events_statements_summary_by_program where OBJECT_TYPE = "PROCEDURE" and OBJECT_SCHEMA = "explain_test_db" and OBJECT_NAME = "explain_test_proc"; COUNT_STAR # OK: handler_read_key incremented drop procedure explain_test_proc; drop table explain_test_db.explain_test_table; drop database explain_test_db;