pbxt.basic_index_lookup and pbxt.basic_pkey_index_reverse_scan don't always use index
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Drizzle |
Fix Released
|
Medium
|
Paul McCullagh | ||
7.0 |
Fix Released
|
Medium
|
Paul McCullagh |
Bug Description
This may be "not a bug". The first query below you'd expect to do an in order index scan instead of reverting to filesort.
pbxt.basic_
--- /home/stewart/
+++ /home/stewart/
@@ -3,7 +3,7 @@
insert into t1 values (1),(2)
explain select * from t1 order by a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 6 Using index
+1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
select * from t1 order by a;
a
1
@@ -14,14 +14,14 @@
200
explain select * from t1 where a>4;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 6 Using where; Using index
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 6 Using where
select * from t1 where a>4;
a
100
200
explain select * from t1 where a<4;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 Using where; Using index
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 6 Using where
select * from t1 where a<4;
a
1
@@ -29,7 +29,7 @@
3
explain select * from t1 where a=4;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
+1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
select * from t1 where a=4;
a
4
Related branches
- Drizzle Merge Team: Pending requested
-
Diff: 247 lines (+78/-68)6 files modifiedplugin/pbxt/src/ha_pbxt.cc (+56/-56)
plugin/pbxt/src/ha_pbxt.h (+1/-7)
plugin/pbxt/tests/r/basic_index_lookup.result (+3/-3)
plugin/pbxt/tests/r/basic_pkey_index_reverse_scan.result (+1/-1)
plugin/pbxt/tests/r/basic_pkey_index_scan.result (+13/-1)
plugin/pbxt/tests/t/basic_pkey_index_scan.test (+4/-0)
Changed in drizzle: | |
importance: | Undecided → Medium |
assignee: | nobody → Paul McCullagh (paul-mccullagh) |
status: | New → Confirmed |
also:
pbxt.basic_ pkey_index_ reverse_ scan [ fail ] drizzle/ working/ tests/. ./plugin/ pbxt/tests/ r/basic_ pkey_index_ reverse_ scan.result 2010-09-17 05:14:16.099317742 +0300 drizzle/ working/ tests/. ./plugin/ pbxt/tests/ r/basic_ pkey_index_ reverse_ scan.reject 2010-09-17 07:55:34.969350595 +0300
--- /home/stewart/
+++ /home/stewart/
@@ -3,7 +3,7 @@
insert into t1 values (1),(2),(3);
explain select * from t1 order by a desc;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 3 Using index
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort
select * from t1 order by a desc;
a
3
drizzletest: Result length mismatch