mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
order_by.result:
result of the test case for FORCE INDEX on ORDER BY order_by.test: test case for FORCE INDEX on ORDER BY sql_select.cc: Changing behaviour that MySQL server takes FORCE INDEX clause into account when optimising ORDER BY clause
This commit is contained in:
@ -546,3 +546,11 @@ CREATE TABLE t1 (a INT, b INT);
|
||||
SET @id=0;
|
||||
UPDATE t1 SET a=0 ORDER BY (a=@id), b;
|
||||
DROP TABLE t1;
|
||||
create table t1(id int not null auto_increment primary key, t char(12));
|
||||
explain select id,t from t1 order by id;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 ALL NULL NULL NULL NULL 1000 Using filesort
|
||||
explain select id,t from t1 force index (primary) order by id;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 index NULL PRIMARY 4 NULL 1000
|
||||
drop table t1;
|
||||
|
@ -352,4 +352,15 @@ CREATE TABLE t1 (a INT, b INT);
|
||||
SET @id=0;
|
||||
UPDATE t1 SET a=0 ORDER BY (a=@id), b;
|
||||
DROP TABLE t1;
|
||||
|
||||
create table t1(id int not null auto_increment primary key, t char(12));
|
||||
disable_query_log;
|
||||
let $1 = 1000;
|
||||
while ($1)
|
||||
{
|
||||
eval insert into t1(t) values ('$1');
|
||||
dec $1;
|
||||
}
|
||||
enable_query_log;
|
||||
explain select id,t from t1 order by id;
|
||||
explain select id,t from t1 force index (primary) order by id;
|
||||
drop table t1;
|
Reference in New Issue
Block a user