mirror of
https://github.com/MariaDB/server.git
synced 2025-11-30 05:23:50 +03:00
267 lines
10 KiB
Plaintext
267 lines
10 KiB
Plaintext
CREATE TABLE test.v1 (a int, b int);
|
|
INSERT INTO test.v1 VALUES (1, 100), (2, 200), (3, 300);
|
|
CREATE TABLE test.t1 (a int, b int);
|
|
INSERT INTO test.t1 VALUES (1, 100), (2, 200), (3, 300);
|
|
TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
|
|
EXPLAIN EXTENDED SELECT * from test.v1;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE v1 ALL NULL NULL NULL NULL 3 100.00
|
|
Warnings:
|
|
Note 1003 select `test`.`v1`.`a` AS `a`,`test`.`v1`.`b` AS `b` from `test`.`v1`
|
|
EXPLAIN EXTENDED SELECT * from test.v1 where a = 1;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE v1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
|
Warnings:
|
|
Note 1003 select `test`.`v1`.`a` AS `a`,`test`.`v1`.`b` AS `b` from `test`.`v1` where `test`.`v1`.`a` = 1
|
|
EXPLAIN EXTENDED SELECT * from test.v1 where b > 100;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE v1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
|
Warnings:
|
|
Note 1003 select `test`.`v1`.`a` AS `a`,`test`.`v1`.`b` AS `b` from `test`.`v1` where `test`.`v1`.`b` > 100
|
|
EXPLAIN EXTENDED SELECT a, b from test.v1;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE v1 ALL NULL NULL NULL NULL 3 100.00
|
|
Warnings:
|
|
Note 1003 select `test`.`v1`.`a` AS `a`,`test`.`v1`.`b` AS `b` from `test`.`v1`
|
|
EXPLAIN EXTENDED SELECT b, a from test.v1;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE v1 ALL NULL NULL NULL NULL 3 100.00
|
|
Warnings:
|
|
Note 1003 select `test`.`v1`.`b` AS `b`,`test`.`v1`.`a` AS `a` from `test`.`v1`
|
|
SELECT * from test.v1;
|
|
a b
|
|
1 100
|
|
2 200
|
|
3 300
|
|
SELECT * from test.v1 where a = 1;
|
|
a b
|
|
1 100
|
|
SELECT * from test.v1 where b > 100;
|
|
a b
|
|
2 200
|
|
3 300
|
|
SELECT a, b from test.v1;
|
|
a b
|
|
1 100
|
|
2 200
|
|
3 300
|
|
SELECT b, a from test.v1;
|
|
b a
|
|
100 1
|
|
200 2
|
|
300 3
|
|
#
|
|
# DIGESTS SEEN ON TABLE
|
|
#
|
|
SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR
|
|
FROM performance_schema.events_statements_summary_by_digest
|
|
ORDER BY DIGEST_TEXT;
|
|
SCHEMA_NAME DIGEST_TEXT COUNT_STAR
|
|
test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` 1
|
|
test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` WHERE `a` = ? 1
|
|
test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` WHERE `b` > ? 1
|
|
test EXPLAIN EXTENDED SELECT `a` , `b` FROM `test` . `v1` 1
|
|
test EXPLAIN EXTENDED SELECT `b` , `a` FROM `test` . `v1` 1
|
|
test SELECT * FROM `test` . `v1` 1
|
|
test SELECT * FROM `test` . `v1` WHERE `a` = ? 1
|
|
test SELECT * FROM `test` . `v1` WHERE `b` > ? 1
|
|
test SELECT `a` , `b` FROM `test` . `v1` 1
|
|
test SELECT `b` , `a` FROM `test` . `v1` 1
|
|
test SHOW WARNINGS 5
|
|
test TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
|
|
DROP TABLE test.v1;
|
|
CREATE VIEW test.v1 AS SELECT * FROM test.t1;
|
|
EXPLAIN EXTENDED SELECT * from test.v1;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
|
|
Warnings:
|
|
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`
|
|
EXPLAIN EXTENDED SELECT * from test.v1 where a = 1;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
|
Warnings:
|
|
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` = 1
|
|
EXPLAIN EXTENDED SELECT * from test.v1 where b > 100;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
|
Warnings:
|
|
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` > 100
|
|
EXPLAIN EXTENDED SELECT a, b from test.v1;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
|
|
Warnings:
|
|
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`
|
|
EXPLAIN EXTENDED SELECT b, a from test.v1;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
|
|
Warnings:
|
|
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t1`
|
|
SELECT * from test.v1;
|
|
a b
|
|
1 100
|
|
2 200
|
|
3 300
|
|
SELECT * from test.v1 where a = 1;
|
|
a b
|
|
1 100
|
|
SELECT * from test.v1 where b > 100;
|
|
a b
|
|
2 200
|
|
3 300
|
|
SELECT a, b from test.v1;
|
|
a b
|
|
1 100
|
|
2 200
|
|
3 300
|
|
SELECT b, a from test.v1;
|
|
b a
|
|
100 1
|
|
200 2
|
|
300 3
|
|
#
|
|
# DIGESTS SEEN ON VIEW
|
|
#
|
|
SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR
|
|
FROM performance_schema.events_statements_summary_by_digest
|
|
ORDER BY DIGEST_TEXT;
|
|
SCHEMA_NAME DIGEST_TEXT COUNT_STAR
|
|
test CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1
|
|
test DROP TABLE `test` . `v1` 1
|
|
test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` 2
|
|
test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` WHERE `a` = ? 2
|
|
test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` WHERE `b` > ? 2
|
|
test EXPLAIN EXTENDED SELECT `a` , `b` FROM `test` . `v1` 2
|
|
test EXPLAIN EXTENDED SELECT `b` , `a` FROM `test` . `v1` 2
|
|
test SELECT * FROM `test` . `v1` 2
|
|
test SELECT * FROM `test` . `v1` WHERE `a` = ? 2
|
|
test SELECT * FROM `test` . `v1` WHERE `b` > ? 2
|
|
test SELECT SCHEMA_NAME , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1
|
|
test SELECT `a` , `b` FROM `test` . `v1` 2
|
|
test SELECT `b` , `a` FROM `test` . `v1` 2
|
|
test SHOW WARNINGS 10
|
|
test TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
|
|
DROP VIEW test.v1;
|
|
DROP TABLE test.t1;
|
|
CREATE TABLE test.v1 (a int, b int);
|
|
INSERT INTO test.v1 VALUES (1, 100), (2, 200), (3, 300);
|
|
CREATE TABLE test.t1 (a int, b int);
|
|
INSERT INTO test.t1 VALUES (1, 100), (2, 200), (3, 300);
|
|
TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
|
|
EXPLAIN SELECT * from test.v1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE v1 ALL NULL NULL NULL NULL 3
|
|
EXPLAIN SELECT * from test.v1 where a = 1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE v1 ALL NULL NULL NULL NULL 3 Using where
|
|
EXPLAIN SELECT * from test.v1 where b > 100;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE v1 ALL NULL NULL NULL NULL 3 Using where
|
|
EXPLAIN SELECT a, b from test.v1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE v1 ALL NULL NULL NULL NULL 3
|
|
EXPLAIN SELECT b, a from test.v1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE v1 ALL NULL NULL NULL NULL 3
|
|
SELECT * from test.v1;
|
|
a b
|
|
1 100
|
|
2 200
|
|
3 300
|
|
SELECT * from test.v1 where a = 1;
|
|
a b
|
|
1 100
|
|
SELECT * from test.v1 where b > 100;
|
|
a b
|
|
2 200
|
|
3 300
|
|
SELECT a, b from test.v1;
|
|
a b
|
|
1 100
|
|
2 200
|
|
3 300
|
|
SELECT b, a from test.v1;
|
|
b a
|
|
100 1
|
|
200 2
|
|
300 3
|
|
#
|
|
# DIGESTS SEEN ON TABLE
|
|
#
|
|
SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR
|
|
FROM performance_schema.events_statements_summary_by_digest
|
|
ORDER BY DIGEST_TEXT;
|
|
SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR
|
|
test 3bcc75e0f4658692e16837ead0c455ca EXPLAIN SELECT * FROM `test` . `v1` 1
|
|
test cc55af8221ef0bc8873e75cc704489ba EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 1
|
|
test bc0498551a492bd7c0ca92906bf86fb4 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 1
|
|
test 76923336b6f4ffffd0d5854761ae1aec EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 1
|
|
test a65d479062ffbfe374b4cd823016a260 EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 1
|
|
test d44b1e50ebfd05accacef4167534ad65 SELECT * FROM `test` . `v1` 1
|
|
test 0608cde507ef8fe35d1f68730e78f1e4 SELECT * FROM `test` . `v1` WHERE `a` = ? 1
|
|
test 5e241fdb866faef138cc81b26203ddff SELECT * FROM `test` . `v1` WHERE `b` > ? 1
|
|
test 74fa770ce44994b3fe7b534d504f2d6d SELECT `a` , `b` FROM `test` . `v1` 1
|
|
test 45ca2a985d179d98395b238cf253bbe2 SELECT `b` , `a` FROM `test` . `v1` 1
|
|
test 1cfa171590aa40ba23e14c92d6940ffc TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
|
|
DROP TABLE test.v1;
|
|
CREATE VIEW test.v1 AS SELECT * FROM test.t1;
|
|
EXPLAIN SELECT * from test.v1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
|
EXPLAIN SELECT * from test.v1 where a = 1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
|
|
EXPLAIN SELECT * from test.v1 where b > 100;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
|
|
EXPLAIN SELECT a, b from test.v1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
|
EXPLAIN SELECT b, a from test.v1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
|
SELECT * from test.v1;
|
|
a b
|
|
1 100
|
|
2 200
|
|
3 300
|
|
SELECT * from test.v1 where a = 1;
|
|
a b
|
|
1 100
|
|
SELECT * from test.v1 where b > 100;
|
|
a b
|
|
2 200
|
|
3 300
|
|
SELECT a, b from test.v1;
|
|
a b
|
|
1 100
|
|
2 200
|
|
3 300
|
|
SELECT b, a from test.v1;
|
|
b a
|
|
100 1
|
|
200 2
|
|
300 3
|
|
#
|
|
# DIGESTS SEEN ON VIEW
|
|
#
|
|
SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR
|
|
FROM performance_schema.events_statements_summary_by_digest
|
|
ORDER BY DIGEST_TEXT;
|
|
SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR
|
|
test 630a0b16be33fcf549f4f467de557940 CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1
|
|
test efa438aa8b4ddbf4c19f9e4b345781b5 DROP TABLE `test` . `v1` 1
|
|
test 3bcc75e0f4658692e16837ead0c455ca EXPLAIN SELECT * FROM `test` . `v1` 2
|
|
test cc55af8221ef0bc8873e75cc704489ba EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 2
|
|
test bc0498551a492bd7c0ca92906bf86fb4 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 2
|
|
test 76923336b6f4ffffd0d5854761ae1aec EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 2
|
|
test a65d479062ffbfe374b4cd823016a260 EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 2
|
|
test d44b1e50ebfd05accacef4167534ad65 SELECT * FROM `test` . `v1` 2
|
|
test 0608cde507ef8fe35d1f68730e78f1e4 SELECT * FROM `test` . `v1` WHERE `a` = ? 2
|
|
test 5e241fdb866faef138cc81b26203ddff SELECT * FROM `test` . `v1` WHERE `b` > ? 2
|
|
test a3788cc4bc96d260cfb5c3ebdfc65c6d SELECT SCHEMA_NAME , `DIGEST` , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1
|
|
test 74fa770ce44994b3fe7b534d504f2d6d SELECT `a` , `b` FROM `test` . `v1` 2
|
|
test 45ca2a985d179d98395b238cf253bbe2 SELECT `b` , `a` FROM `test` . `v1` 2
|
|
test 1cfa171590aa40ba23e14c92d6940ffc TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
|
|
DROP VIEW test.v1;
|
|
DROP TABLE test.t1;
|