mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
0c835da803
- added join cache indication in EXPLAIN (Extra column). - prefer filesort over full scan over index for ORDER BY (because it's faster). - when switching from REF to RANGE because RANGE uses longer key turn off sort on the head table only as the resulting RANGE access is a candidate for join cache and we don't want to disable it by sorting on the first table only. mysql-test/r/archive_gis.result: bug #27531: join cache in EXPLAIN mysql-test/r/compress.result: bug #27531: - join cache in EXPLAIN. - prefer filesort over full scan over index for ORDER BY. mysql-test/r/ctype_utf8.result: bug #27531: join cache in EXPLAIN mysql-test/r/derived.result: bug #27531: join cache in EXPLAIN mysql-test/r/distinct.result: bug #27531: join cache in EXPLAIN mysql-test/r/func_group.result: bug #27531: join cache in EXPLAIN mysql-test/r/func_group_innodb.result: bug #27531: join cache in EXPLAIN mysql-test/r/gis.result: bug #27531: join cache in EXPLAIN mysql-test/r/greedy_optimizer.result: bug #27531: join cache in EXPLAIN mysql-test/r/group_by.result: bug #27531: join cache in EXPLAIN mysql-test/r/group_min_max.result: bug #27531: join cache in EXPLAIN mysql-test/r/index_merge_myisam.result: bug #27531: join cache in EXPLAIN mysql-test/r/information_schema.result: bug #27531: join cache in EXPLAIN mysql-test/r/innodb_gis.result: bug #27531: join cache in EXPLAIN mysql-test/r/innodb_mysql.result: bug #27531: join cache in EXPLAIN mysql-test/r/join.result: bug #27531: join cache in EXPLAIN mysql-test/r/join_nested.result: bug #27531: join cache in EXPLAIN mysql-test/r/key_diff.result: bug #27531: join cache in EXPLAIN mysql-test/r/myisam.result: bug #27531: join cache in EXPLAIN mysql-test/r/ndb_condition_pushdown.result: bug #27531: join cache in EXPLAIN mysql-test/r/ndb_gis.result: bug #27531: join cache in EXPLAIN mysql-test/r/range.result: bug #27531: join cache in EXPLAIN mysql-test/r/row.result: bug #27531: join cache in EXPLAIN mysql-test/r/select.result: bug #27531: - join cache in EXPLAIN. - prefer filesort over full scan over index for ORDER BY. mysql-test/r/ssl.result: bug #27531: - join cache in EXPLAIN. - prefer filesort over full scan over index for ORDER BY. mysql-test/r/ssl_compress.result: bug #27531: - join cache in EXPLAIN. - prefer filesort over full scan over index for ORDER BY. mysql-test/r/subselect.result: bug #27531: join cache in EXPLAIN mysql-test/r/subselect3.result: bug #27531: join cache in EXPLAIN mysql-test/r/union.result: bug #27531: join cache in EXPLAIN mysql-test/r/view.result: bug #27531: join cache in EXPLAIN sql/sql_select.cc: bug #27531: - join cache in EXPLAIN. - prefer filesort over full scan over index for ORDER BY. - disable sorting on the first table only when switching from REF to RANGE.
52 lines
826 B
Text
52 lines
826 B
Text
drop table if exists t1;
|
|
CREATE TABLE t1 (
|
|
a char(5) NOT NULL,
|
|
b char(4) NOT NULL,
|
|
KEY (a),
|
|
KEY (b)
|
|
);
|
|
INSERT INTO t1 VALUES ('A','B'),('b','A'),('C','c'),('D','E'),('a','a');
|
|
select * from t1,t1 as t2;
|
|
a b a b
|
|
A B A B
|
|
b A A B
|
|
C c A B
|
|
D E A B
|
|
a a A B
|
|
A B b A
|
|
b A b A
|
|
C c b A
|
|
D E b A
|
|
a a b A
|
|
A B C c
|
|
b A C c
|
|
C c C c
|
|
D E C c
|
|
a a C c
|
|
A B D E
|
|
b A D E
|
|
C c D E
|
|
D E D E
|
|
a a D E
|
|
A B a a
|
|
b A a a
|
|
C c a a
|
|
D E a a
|
|
a a a a
|
|
explain select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 ALL a NULL NULL NULL 5 Using join cache
|
|
1 SIMPLE t2 ALL b NULL NULL NULL 5 Using where
|
|
select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B order by binary t1.a,t2.a;
|
|
a b a b
|
|
A B a a
|
|
A B b A
|
|
C c C c
|
|
a a a a
|
|
a a b A
|
|
b A A B
|
|
select * from t1 where a='a';
|
|
a b
|
|
A B
|
|
a a
|
|
drop table t1;
|