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
4274e9b5
Commit
4274e9b5
authored
Jul 15, 2010
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix order_by test failure: don't run EXPLAIN for a query that has multiple
range plans with identical costs.
parent
11b19493
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
mysql-test/r/order_by.result
mysql-test/r/order_by.result
+7
-2
mysql-test/t/order_by.test
mysql-test/t/order_by.test
+5
-1
No files found.
mysql-test/r/order_by.result
View file @
4274e9b5
...
...
@@ -607,9 +607,14 @@ FieldKey LongVal StringVal
1 0 2
1 1 3
1 2 1
EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
DS-MRR: use two IGNORE INDEX queries, otherwise we get cost races, because
DS-MRR: records_in_range/read_time return the same numbers for all three indexes
EXPLAIN SELECT * FROM t1 IGNORE INDEX (LongField, StringField) WHERE FieldKey > '2' ORDER BY LongVal;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range FieldKey,LongField,StringField FieldKey 38 NULL 4 Using index condition; Using where; Using MRR; Using filesort
1 SIMPLE t1 range FieldKey FieldKey 38 NULL 4 Using index condition; Using MRR; Using filesort
EXPLAIN SELECT * FROM t1 IGNORE INDEX (FieldKey, LongField) WHERE FieldKey > '2' ORDER BY LongVal;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range StringField StringField 38 NULL 4 Using where; Using filesort
SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
FieldKey LongVal StringVal
3 1 2
...
...
mysql-test/t/order_by.test
View file @
4274e9b5
...
...
@@ -402,7 +402,11 @@ CREATE TABLE t1 (
INSERT
INTO
t1
VALUES
(
'0'
,
3
,
'0'
),(
'0'
,
2
,
'1'
),(
'0'
,
1
,
'2'
),(
'1'
,
2
,
'1'
),(
'1'
,
1
,
'3'
),
(
'1'
,
0
,
'2'
),(
'2'
,
3
,
'0'
),(
'2'
,
2
,
'1'
),(
'2'
,
1
,
'2'
),(
'2'
,
3
,
'0'
),(
'2'
,
2
,
'1'
),(
'2'
,
1
,
'2'
),(
'3'
,
2
,
'1'
),(
'3'
,
1
,
'2'
),(
'3'
,
'3'
,
'3'
);
EXPLAIN
SELECT
*
FROM
t1
WHERE
FieldKey
=
'1'
ORDER
BY
LongVal
;
SELECT
*
FROM
t1
WHERE
FieldKey
=
'1'
ORDER
BY
LongVal
;
EXPLAIN
SELECT
*
FROM
t1
WHERE
FieldKey
>
'2'
ORDER
BY
LongVal
;
--
echo
DS
-
MRR
:
use
two
IGNORE INDEX queries, otherwise we get cost races, because
--echo DS-MRR: records_in_range/read_time return the same numbers for all three indexes
EXPLAIN SELECT * FROM t1 IGNORE INDEX (LongField, StringField) WHERE FieldKey > '2' ORDER BY LongVal
;
EXPLAIN
SELECT
*
FROM
t1
IGNORE
INDEX
(
FieldKey
,
LongField
)
WHERE
FieldKey
>
'2'
ORDER
BY
LongVal
;
SELECT
*
FROM
t1
WHERE
FieldKey
>
'2'
ORDER
BY
LongVal
;
EXPLAIN
SELECT
*
FROM
t1
WHERE
FieldKey
>
'2'
ORDER
BY
FieldKey
,
LongVal
;
SELECT
*
FROM
t1
WHERE
FieldKey
>
'2'
ORDER
BY
FieldKey
,
LongVal
;
...
...
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