Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
b2b69607
Commit
b2b69607
authored
Sep 27, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#21174: Index degrades sort performance and optimizer does not honor IGNORE INDEX
- fix moved to 5.1
parent
c689d424
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
mysql-test/r/group_by.result
mysql-test/r/group_by.result
+9
-0
mysql-test/t/group_by.test
mysql-test/t/group_by.test
+12
-0
sql/sql_select.cc
sql/sql_select.cc
+2
-0
No files found.
mysql-test/r/group_by.result
View file @
b2b69607
...
...
@@ -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;
mysql-test/t/group_by.test
View file @
b2b69607
...
...
@@ -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
;
sql/sql_select.cc
View file @
b2b69607
...
...
@@ -11875,6 +11875,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment