Below is the list of changes that have just been committed into a local
5.0 repository of kgeorge. When kgeorge does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-08-14 18:19:29+03:00, gkodinov@stripped +3 -0
Bug #21174: Index degrades sort performance and
optimizer does not honor IGNORE INDEX
- Allow an index to be used for sorting the table
instead of filesort only if it is not disabled by
IGNORE INDEX.
mysql-test/r/group_by.result@stripped, 2006-08-14 18:19:22+03:00, gkodinov@stripped +9 -0
Bug #21174: Index degrades sort performance and
optimizer does not honor IGNORE INDEX
- test case
mysql-test/t/group_by.test@stripped, 2006-08-14 18:19:23+03:00, gkodinov@stripped +12 -0
Bug #21174: Index degrades sort performance and
optimizer does not honor IGNORE INDEX
- test case
sql/sql_select.cc@stripped, 2006-08-14 18:19:24+03:00, gkodinov@stripped +2 -0
Bug #21174: Index degrades sort performance and
optimizer does not honor IGNORE INDEX
- Allow an index to be used for sorting the table
instead of filesort only if it is not disabled by
IGNORE INDEX.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: gkodinov
# Host: macbook.gmz
# Root: /Users/kgeorge/mysql/work/B21174-5.0-opt
--- 1.442/sql/sql_select.cc 2006-08-14 18:19:45 +03:00
+++ 1.443/sql/sql_select.cc 2006-08-14 18:19:45 +03:00
@@ -11498,6 +11498,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,OR
We must not try to use disabled keys.
*/
usable_keys= table->s->keys_in_use;
+ /* we must not consider keys that are disabled by IGNORE INDEX */
+ usable_keys.intersect(table->keys_in_use_for_query);
for (ORDER *tmp_order=order; tmp_order ; tmp_order=tmp_order->next)
{
--- 1.69/mysql-test/r/group_by.result 2006-08-14 18:19:46 +03:00
+++ 1.70/mysql-test/r/group_by.result 2006-08-14 18:19:46 +03:00
@@ -821,3 +821,12 @@ a b real_b
68 France France
DROP VIEW v1;
DROP TABLE t1,t2;
+CREATE TABLE t1 (a INT, b INT, KEY(a));
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3,3), (4,4);
+EXPLAIN SELECT a, SUM(b) FROM t1 GROUP BY a LIMIT 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 5 NULL 4
+EXPLAIN SELECT a, SUM(b) FROM t1 IGNORE INDEX (a) GROUP BY a LIMIT 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
+DROP TABLE t1;
--- 1.57/mysql-test/t/group_by.test 2006-08-14 18:19:46 +03:00
+++ 1.58/mysql-test/t/group_by.test 2006-08-14 18:19:46 +03:00
@@ -655,3 +655,15 @@ where t2.b=v1.a GROUP BY t2.b;
DROP VIEW v1;
DROP TABLE t1,t2;
+
+#
+# Bug #21174: Index degrades sort performance and
+# optimizer does not honor IGNORE INDEX
+#
+CREATE TABLE t1 (a INT, b INT, KEY(a));
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3,3), (4,4);
+
+EXPLAIN SELECT a, SUM(b) FROM t1 GROUP BY a LIMIT 2;
+EXPLAIN SELECT a, SUM(b) FROM t1 IGNORE INDEX (a) GROUP BY a LIMIT 2;
+
+DROP TABLE t1;
| Thread |
|---|
| • bk commit into 5.0 tree (gkodinov:1.2227) BUG#21174 | kgeorge | 14 Aug |