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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
e024d633
Commit
e024d633
authored
Aug 15, 2006
by
gkodinov/kgeorge@rakia.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into rakia.(none):/home/kgeorge/mysql/autopush/B21159-5.0-opt
parents
5f242d08
18c52dc2
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 @
e024d633
...
...
@@ -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 @
e024d633
...
...
@@ -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 @
e024d633
...
...
@@ -11518,6 +11518,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