Bug #83716 MySQL performance-schema doesn't store (analyze) queries to views
Submitted: 7 Nov 2016 9:31 Modified: 8 Nov 2016 6:44
Reporter: Libor Laichmann Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: SYS Schema Severity:S2 (Serious)
Version:5.7.14, 5.7.16 OS:Any
Assigned to: CPU Architecture:Any

[7 Nov 2016 9:31] Libor Laichmann
Description:
MySQL performance-schema doesn't store (analyze) queries to views. In the performance-schema it can be found just a query of view. The query that uses this view, but nowhere.

How to repeat:
drop table test;    
create table test (
  code varchar(10),
  value varchar(100),
  flag tinyint
);

create or replace view v_test as select 
  code,
  value,
  flag
from test where flag = 1;

insert into test values 
('a','aaaa', 1),('b','bbbb', 1),('c','cccc', 0),('d','dddd', 0),('e','eeee', 1),('f','ffff', 1);

select * from v_test where code = 'e';

select * from sys.`statements_with_full_table_scans` where query like '%test%';

select * from test where code = 'a';

select * from sys.`statements_with_full_table_scans` where query like '%test%';
[8 Nov 2016 6:44] Umesh Shastry
Hello Libor Laichmann,

Thank you for the report.

Thanks,
Umesh