DESC sys.statements_with_full_table_scans;
Field	Type	Null	Key	Default	Extra
query	longtext	YES		NULL
db	varchar(64)	YES		NULL
exec_count	bigint(20) unsigned	NO		NULL
total_latency	text	YES		NULL
no_index_used_count	bigint(20) unsigned	NO		NULL
no_good_index_used_count	bigint(20) unsigned	NO		NULL
no_index_used_pct	decimal(24,0)	NO		0
rows_sent	bigint(20) unsigned	NO		NULL
rows_examined	bigint(20) unsigned	NO		NULL
rows_sent_avg	decimal(21,0) unsigned	YES		NULL
rows_examined_avg	decimal(21,0) unsigned	YES		NULL
first_seen	timestamp	NO		0000-00-00 00:00:00
last_seen	timestamp	NO		0000-00-00 00:00:00
digest	varchar(32)	YES		NULL
SELECT * FROM sys.statements_with_full_table_scans;
DESC sys.x$statements_with_full_table_scans;
Field	Type	Null	Key	Default	Extra
query	longtext	YES		NULL
db	varchar(64)	YES		NULL
exec_count	bigint(20) unsigned	NO		NULL
total_latency	bigint(20) unsigned	NO		NULL
no_index_used_count	bigint(20) unsigned	NO		NULL
no_good_index_used_count	bigint(20) unsigned	NO		NULL
no_index_used_pct	decimal(24,0)	NO		0
rows_sent	bigint(20) unsigned	NO		NULL
rows_examined	bigint(20) unsigned	NO		NULL
rows_sent_avg	decimal(21,0) unsigned	YES		NULL
rows_examined_avg	decimal(21,0) unsigned	YES		NULL
first_seen	timestamp	NO		0000-00-00 00:00:00
last_seen	timestamp	NO		0000-00-00 00:00:00
digest	varchar(32)	YES		NULL
SELECT * FROM sys.x$statements_with_full_table_scans;
CREATE DATABASE v_statements_with_full_table_scans;
CREATE TABLE v_statements_with_full_table_scans.t (i BIGINT AUTO_INCREMENT PRIMARY KEY, j BIGINT) ENGINE = innodb;
INSERT INTO v_statements_with_full_table_scans.t (j) VALUES (1), (2), (3);
INSERT INTO v_statements_with_full_table_scans.t (j) (SELECT j*2 FROM v_statements_with_full_table_scans.t);
INSERT INTO v_statements_with_full_table_scans.t (j) (SELECT j*2 FROM v_statements_with_full_table_scans.t);
INSERT INTO v_statements_with_full_table_scans.t (j) (SELECT j*2 FROM v_statements_with_full_table_scans.t);
INSERT INTO v_statements_with_full_table_scans.t (j) (SELECT j*2 FROM v_statements_with_full_table_scans.t);
INSERT INTO v_statements_with_full_table_scans.t (j) (SELECT j*2 FROM v_statements_with_full_table_scans.t);
INSERT INTO v_statements_with_full_table_scans.t (j) (SELECT j*2 FROM v_statements_with_full_table_scans.t);
INSERT INTO v_statements_with_full_table_scans.t (j) (SELECT j*2 FROM v_statements_with_full_table_scans.t);
INSERT INTO v_statements_with_full_table_scans.t (j) (SELECT j*2 FROM v_statements_with_full_table_scans.t);
CALL sys.ps_truncate_all_tables(false);
summary
Truncated 44 tables
SELECT i, j, RAND() FROM v_statements_with_full_table_scans.t WHERE j = 12;
SELECT db, query, rows_examined FROM sys.statements_with_full_table_scans WHERE query LIKE '%v_statements_with_full_table_scans%' ORDER BY rows_examined DESC;
db	query	rows_examined
SELECT db, query, rows_examined FROM sys.x$statements_with_full_table_scans WHERE query LIKE '%v_statements_with_full_table_scans%' ORDER BY rows_examined DESC;
db	query	rows_examined
test	SELECT `i` , `j` , `RAND` ( ) FROM `v_statements_with_full_table_scans` . `t` WHERE `j` = ? 	768
SELECT i, j, RAND() FROM v_statements_with_full_table_scans.t WHERE j = 12;
SELECT db, query, rows_examined FROM sys.statements_with_full_table_scans WHERE query LIKE '%v_statements_with_full_table_scans%' ORDER BY rows_examined DESC;
db	query	rows_examined
SELECT db, query, rows_examined FROM sys.x$statements_with_full_table_scans WHERE query LIKE '%v_statements_with_full_table_scans%' ORDER BY rows_examined DESC;
db	query	rows_examined
test	SELECT `i` , `j` , `RAND` ( ) FROM `v_statements_with_full_table_scans` . `t` WHERE `j` = ? 	1536
SELECT * FROM v_statements_with_full_table_scans.t WHERE i = 10;
i	j
10	4
SELECT db, query, rows_examined FROM sys.statements_with_full_table_scans WHERE query LIKE '%v_statements_with_full_table_scans%' ORDER BY rows_examined DESC;
db	query	rows_examined
SELECT db, query, rows_examined FROM sys.x$statements_with_full_table_scans WHERE query LIKE '%v_statements_with_full_table_scans%' ORDER BY rows_examined DESC;
db	query	rows_examined
test	SELECT `i` , `j` , `RAND` ( ) FROM `v_statements_with_full_table_scans` . `t` WHERE `j` = ? 	1536
DROP DATABASE v_statements_with_full_table_scans;
