mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
Fix order_by test failure: don't run EXPLAIN for a query that has multiple
range plans with identical costs.
This commit is contained in:
parent
11b1949303
commit
4274e9b5d4
2 changed files with 12 additions and 3 deletions
|
@ -607,9 +607,14 @@ FieldKey LongVal StringVal
|
|||
1 0 2
|
||||
1 1 3
|
||||
1 2 1
|
||||
EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
|
||||
DS-MRR: use two IGNORE INDEX queries, otherwise we get cost races, because
|
||||
DS-MRR: records_in_range/read_time return the same numbers for all three indexes
|
||||
EXPLAIN SELECT * FROM t1 IGNORE INDEX (LongField, StringField) WHERE FieldKey > '2' ORDER BY LongVal;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range FieldKey,LongField,StringField FieldKey 38 NULL 4 Using index condition; Using where; Using MRR; Using filesort
|
||||
1 SIMPLE t1 range FieldKey FieldKey 38 NULL 4 Using index condition; Using MRR; Using filesort
|
||||
EXPLAIN SELECT * FROM t1 IGNORE INDEX (FieldKey, LongField) WHERE FieldKey > '2' ORDER BY LongVal;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range StringField StringField 38 NULL 4 Using where; Using filesort
|
||||
SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
|
||||
FieldKey LongVal StringVal
|
||||
3 1 2
|
||||
|
|
|
@ -402,7 +402,11 @@ CREATE TABLE t1 (
|
|||
INSERT INTO t1 VALUES ('0',3,'0'),('0',2,'1'),('0',1,'2'),('1',2,'1'),('1',1,'3'), ('1',0,'2'),('2',3,'0'),('2',2,'1'),('2',1,'2'),('2',3,'0'),('2',2,'1'),('2',1,'2'),('3',2,'1'),('3',1,'2'),('3','3','3');
|
||||
EXPLAIN SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal;
|
||||
SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal;
|
||||
EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
|
||||
--echo DS-MRR: use two IGNORE INDEX queries, otherwise we get cost races, because
|
||||
--echo DS-MRR: records_in_range/read_time return the same numbers for all three indexes
|
||||
EXPLAIN SELECT * FROM t1 IGNORE INDEX (LongField, StringField) WHERE FieldKey > '2' ORDER BY LongVal;
|
||||
EXPLAIN SELECT * FROM t1 IGNORE INDEX (FieldKey, LongField) WHERE FieldKey > '2' ORDER BY LongVal;
|
||||
|
||||
SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
|
||||
EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal;
|
||||
SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal;
|
||||
|
|
Loading…
Reference in a new issue