mirror of
https://github.com/MariaDB/server.git
synced 2026-05-08 08:04:29 +02:00
MWL#110: Make EXPLAIN always show materialization separately
- Add Item_in_subselect::get_identifier() that returns subquery's id - Change select_describe() to produce output in new format - Update test results (checked)
This commit is contained in:
parent
218310b162
commit
8a06a7e3a7
11 changed files with 246 additions and 82 deletions
|
|
@ -1190,8 +1190,9 @@ INSERT INTO t2 VALUES (13, 1.454);
|
|||
SET @@optimizer_switch='default,semijoin=on,materialization=on';
|
||||
EXPLAIN SELECT COUNT(*) FROM t1 WHERE (f1,f2) IN (SELECT f1,f2 FROM t2);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Materialize; Scan
|
||||
1 PRIMARY subselect2 ALL unique_key NULL NULL NULL 2
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer
|
||||
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2
|
||||
SELECT COUNT(*) FROM t1 WHERE (f1,f2) IN (SELECT f1,f2 FROM t2);
|
||||
COUNT(*)
|
||||
2
|
||||
|
|
@ -1211,7 +1212,8 @@ SET @@optimizer_switch='default,semijoin=on,materialization=on';
|
|||
EXPLAIN SELECT pk FROM t1 WHERE (a) IN (SELECT a FROM t2 WHERE pk > 0);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
|
||||
1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using MRR; Materialize
|
||||
1 PRIMARY subselect2 eq_ref unique_key unique_key 5 func 1
|
||||
2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using MRR
|
||||
SELECT pk FROM t1 WHERE (a) IN (SELECT a FROM t2 WHERE pk > 0);
|
||||
pk
|
||||
2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue