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
a55f0cab
Commit
a55f0cab
authored
Oct 03, 2011
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a bad merge.
Changed a test case to make its result set platform independent.
parent
e1194ad6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
40 deletions
+28
-40
mysql-test/r/join_cache.result
mysql-test/r/join_cache.result
+16
-28
mysql-test/t/join_cache.test
mysql-test/t/join_cache.test
+12
-6
sql/sql_select.cc
sql/sql_select.cc
+0
-6
No files found.
mysql-test/r/join_cache.result
View file @
a55f0cab
...
...
@@ -4283,57 +4283,51 @@ INSERT INTO t3 VALUES
(16,6,'e'), (17,3,'t'), (18,8,'j'), (19,5,'h'), (20,7,'w');
SET SESSION join_cache_level=1;
EXPLAIN
SELECT t2.v FROM t1, t2, t3 WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v
SELECT t2.v FROM t1, t2, t3
WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
GROUP BY t2.v ORDER BY t1.pk,t2.v;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index idx1 idx2 7 NULL 20 Using index; Using temporary; Using filesort
1 SIMPLE t3 eq_ref PRIMARY,idx2 PRIMARY 4 test.t2.i 1 Using where
1 SIMPLE t1 ref idx2 idx2 3 test.t3.v 5
SELECT t2.v FROM t1, t2, t3 WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v
1 SIMPLE t1 ref idx2 idx2 3 test.t3.v 5 Using where
SELECT t2.v FROM t1, t2, t3
WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
GROUP BY t2.v ORDER BY t1.pk,t2.v;
v
h
z
p
n
d
f
s
a
v
m
y
SET SESSION join_cache_level=6;
EXPLAIN
SELECT t2.v FROM t1, t2, t3 WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v
SELECT t2.v FROM t1, t2, t3
WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
GROUP BY t2.v ORDER BY t1.pk,t2.v;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL idx1 NULL NULL NULL 20 Using temporary; Using filesort
1 SIMPLE t3 eq_ref PRIMARY,idx2 PRIMARY 4 test.t2.i 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
1 SIMPLE t1 ref idx2 idx2 3 test.t3.v 5 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
SELECT t2.v FROM t1, t2, t3 WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v
1 SIMPLE t1 ref idx2 idx2 3 test.t3.v 5 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
SELECT t2.v FROM t1, t2, t3
WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
GROUP BY t2.v ORDER BY t1.pk,t2.v;
v
z
h
n
p
d
m
y
a
f
s
v
p
SET SESSION join_cache_level=4;
EXPLAIN
SELECT t2.v FROM t1, t2, t3 WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v
SELECT t2.v FROM t1, t2, t3
WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
GROUP BY t2.v ORDER BY t1.pk,t2.v;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL idx1 NULL NULL NULL 20 Using temporary; Using filesort
1 SIMPLE t3 hash_ALL PRIMARY,idx2 #hash#PRIMARY 4 test.t2.i 20 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE t1 hash_ALL idx2 #hash#idx2 3 test.t3.v 45 Using join buffer (incremental, BNLH join)
SELECT t2.v FROM t1, t2, t3 WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v
1 SIMPLE t1 hash_ALL idx2 #hash#idx2 3 test.t3.v 45 Using where; Using join buffer (incremental, BNLH join)
SELECT t2.v FROM t1, t2, t3
WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100
GROUP BY t2.v ORDER BY t1.pk,t2.v;
v
h
...
...
@@ -4341,12 +4335,6 @@ z
n
v
p
d
m
y
a
f
s
DROP TABLE t1,t2,t3;
SET SESSION join_cache_level=DEFAULT;
#
...
...
mysql-test/t/join_cache.test
View file @
a55f0cab
...
...
@@ -2489,23 +2489,29 @@ INSERT INTO t3 VALUES
SET
SESSION
join_cache_level
=
1
;
EXPLAIN
SELECT
t2
.
v
FROM
t1
,
t2
,
t3
WHERE
t3
.
v
<>
t2
.
v
AND
t3
.
pk
=
t2
.
i
AND
t1
.
v
=
t3
.
v
SELECT
t2
.
v
FROM
t1
,
t2
,
t3
WHERE
t3
.
v
<>
t2
.
v
AND
t3
.
pk
=
t2
.
i
AND
t1
.
v
=
t3
.
v
AND
t1
.
pk
*
2
<
100
GROUP
BY
t2
.
v
ORDER
BY
t1
.
pk
,
t2
.
v
;
SELECT
t2
.
v
FROM
t1
,
t2
,
t3
WHERE
t3
.
v
<>
t2
.
v
AND
t3
.
pk
=
t2
.
i
AND
t1
.
v
=
t3
.
v
SELECT
t2
.
v
FROM
t1
,
t2
,
t3
WHERE
t3
.
v
<>
t2
.
v
AND
t3
.
pk
=
t2
.
i
AND
t1
.
v
=
t3
.
v
AND
t1
.
pk
*
2
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100
GROUP
BY
t2
.
v
ORDER
BY
t1
.
pk
,
t2
.
v
;
DROP
TABLE
t1
,
t2
,
t3
;
...
...
sql/sql_select.cc
View file @
a55f0cab
...
...
@@ -17969,12 +17969,6 @@ skipped_filesort:
delete
save_quick
;
save_quick
=
NULL
;
}
/*
orig_cond is a part of pre_idx_push_cond,
no need to restore it.
*/
orig_cond
=
0
;
orig_cond_saved
=
false
;
if
(
orig_cond_saved
&&
!
changed_key
)
tab
->
set_cond
(
orig_cond
);
DBUG_RETURN
(
1
);
...
...
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