| 1 |
DESC sys.statements_with_full_table_scans; |
| 2 |
Field Type Null Key Default Extra |
| 3 |
query longtext YES NULL |
| 4 |
db varchar(64) YES NULL |
| 5 |
exec_count bigint unsigned NO NULL |
| 6 |
total_latency varchar(11) YES NULL |
| 7 |
no_index_used_count bigint unsigned NO NULL |
| 8 |
no_good_index_used_count bigint unsigned NO NULL |
| 9 |
no_index_used_pct decimal(24,0) NO 0 |
| 10 |
rows_sent bigint unsigned NO NULL |
| 11 |
rows_examined bigint unsigned NO NULL |
| 12 |
rows_sent_avg decimal(21,0) YES NULL |
| 13 |
rows_examined_avg decimal(21,0) YES NULL |
| 14 |
first_seen timestamp(6) NO NULL |
| 15 |
last_seen timestamp(6) NO NULL |
| 16 |
digest varchar(64) YES NULL |
| 17 |
SELECT * FROM sys.statements_with_full_table_scans; |
| 18 |
DESC sys.x$statements_with_full_table_scans; |
| 19 |
Field Type Null Key Default Extra |
| 20 |
query longtext YES NULL |
| 21 |
db varchar(64) YES NULL |
| 22 |
exec_count bigint unsigned NO NULL |
| 23 |
total_latency bigint unsigned NO NULL |
| 24 |
no_index_used_count bigint unsigned NO NULL |
| 25 |
no_good_index_used_count bigint unsigned NO NULL |
| 26 |
no_index_used_pct decimal(24,0) NO 0 |
| 27 |
rows_sent bigint unsigned NO NULL |
| 28 |
rows_examined bigint unsigned NO NULL |
| 29 |
rows_sent_avg decimal(21,0) YES NULL |
| 30 |
rows_examined_avg decimal(21,0) YES NULL |
| 31 |
first_seen timestamp(6) NO NULL |
| 32 |
last_seen timestamp(6) NO NULL |
| 33 |
digest varchar(64) YES NULL |
| 34 |
SELECT * FROM sys.x$statements_with_full_table_scans; |
| 35 |
CREATE DATABASE v_statements_with_full_table_scans; |
| 36 |
CREATE TABLE v_statements_with_full_table_scans.t (i BIGINT AUTO_INCREMENT PRIMARY KEY, j BIGINT) ENGINE = innodb; |
| 37 |
INSERT INTO v_statements_with_full_table_scans.t (j) VALUES (1), (2), (3); |
| 38 |
INSERT INTO v_statements_with_full_table_scans.t (j) (SELECT j*2 FROM v_statements_with_full_table_scans.t); |
| 39 |
INSERT INTO v_statements_with_full_table_scans.t (j) (SELECT j*2 FROM v_statements_with_full_table_scans.t); |
| 40 |
INSERT INTO v_statements_with_full_table_scans.t (j) (SELECT j*2 FROM v_statements_with_full_table_scans.t); |
| 41 |
INSERT INTO v_statements_with_full_table_scans.t (j) (SELECT j*2 FROM v_statements_with_full_table_scans.t); |
| 42 |
INSERT INTO v_statements_with_full_table_scans.t (j) (SELECT j*2 FROM v_statements_with_full_table_scans.t); |
| 43 |
INSERT INTO v_statements_with_full_table_scans.t (j) (SELECT j*2 FROM v_statements_with_full_table_scans.t); |
| 44 |
INSERT INTO v_statements_with_full_table_scans.t (j) (SELECT j*2 FROM v_statements_with_full_table_scans.t); |
| 45 |
INSERT INTO v_statements_with_full_table_scans.t (j) (SELECT j*2 FROM v_statements_with_full_table_scans.t); |
| 46 |
CALL sys.ps_truncate_all_tables(false); |
| 47 |
summary |
| 48 |
Truncated 49 tables |
| 49 |
SELECT i, j, RAND() FROM v_statements_with_full_table_scans.t WHERE j = 12; |
| 50 |
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; |
| 51 |
db query rows_examined |
| 52 |
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; |
| 53 |
db query rows_examined |
| 54 |
test SELECT `i` , `j` , `RAND` ( ) FROM `v_statements_with_full_table_scans` . `t` WHERE `j` = ? 768 |
| 55 |
SELECT i, j, RAND() FROM v_statements_with_full_table_scans.t WHERE j = 12; |
| 56 |
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; |
| 57 |
db query rows_examined |
| 58 |
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; |
| 59 |
db query rows_examined |
| 60 |
test SELECT `i` , `j` , `RAND` ( ) FROM `v_statements_with_full_table_scans` . `t` WHERE `j` = ? 1536 |
| 61 |
SELECT * FROM v_statements_with_full_table_scans.t WHERE i = 10; |
| 62 |
i j |
| 63 |
10 4 |
| 64 |
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; |
| 65 |
db query rows_examined |
| 66 |
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; |
| 67 |
db query rows_examined |
| 68 |
test SELECT `i` , `j` , `RAND` ( ) FROM `v_statements_with_full_table_scans` . `t` WHERE `j` = ? 1536 |
| 69 |
DROP DATABASE v_statements_with_full_table_scans; |