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
ccce4d3b
Commit
ccce4d3b
authored
Feb 14, 2019
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-16188 Post review fixes
Also adjusted some test files.
parent
e1de23b8
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
39 additions
and
34 deletions
+39
-34
mysql-test/include/icp_tests.inc
mysql-test/include/icp_tests.inc
+1
-0
mysql-test/include/index_merge1.inc
mysql-test/include/index_merge1.inc
+3
-2
mysql-test/main/index_merge_myisam.result
mysql-test/main/index_merge_myisam.result
+5
-10
mysql-test/main/innodb_ext_key.result
mysql-test/main/innodb_ext_key.result
+4
-4
mysql-test/main/innodb_ext_key.test
mysql-test/main/innodb_ext_key.test
+2
-0
mysql-test/main/subselect_sj2.result
mysql-test/main/subselect_sj2.result
+4
-4
mysql-test/main/subselect_sj2.test
mysql-test/main/subselect_sj2.test
+2
-0
mysql-test/main/subselect_sj2_jcl6.result
mysql-test/main/subselect_sj2_jcl6.result
+4
-4
mysql-test/main/subselect_sj2_mat.result
mysql-test/main/subselect_sj2_mat.result
+4
-4
sql/rowid_filter.cc
sql/rowid_filter.cc
+9
-5
sql/rowid_filter.h
sql/rowid_filter.h
+1
-1
No files found.
mysql-test/include/icp_tests.inc
View file @
ccce4d3b
...
...
@@ -226,6 +226,7 @@ EXPLAIN
SELECT
c1
FROM
t3
WHERE
c1
>=
'c-1004=w'
and
c1
<=
'c-1006=w'
and
i1
>
2
;
SELECT
c1
FROM
t3
WHERE
c1
>=
'c-1004=w'
and
c1
<=
'c-1006=w'
and
i1
>
2
;
--
replace_column
9
100
EXPLAIN
SELECT
c1
FROM
t3
WHERE
c1
>=
'c-1004=w'
and
c1
<=
'c-1006=w'
or
i1
>
2
;
SELECT
c1
FROM
t3
WHERE
c1
>=
'c-1004=w'
and
c1
<=
'c-1006=w'
or
i1
>
2
;
...
...
mysql-test/include/index_merge1.inc
View file @
ccce4d3b
...
...
@@ -479,6 +479,7 @@ create table t2(
)
ENGINE
=
MEMORY
DEFAULT
CHARSET
=
latin1
;
insert
into
t2
select
*
from
t1
;
--
echo
must
use
sort
-union rather than union:
--replace_column 9 #
explain select * from t1 where a=4 or b=4
;
...
...
@@ -489,9 +490,9 @@ select * from t1 ignore index(a,b) where a=4 or b=4;
--
echo
must
use
union
, not sort-union:
--replace_column 9 #
explain select * from t2 where a=
4 or b=4
;
explain select * from t2 where a=
2 or b=2
;
--
sorted_result
select
*
from
t2
where
a
=
4
or
b
=
4
;
select
*
from
t2
where
a
=
2
or
b
=
2
;
drop
table
t1
,
t2
;
...
...
mysql-test/main/index_merge_myisam.result
View file @
ccce4d3b
...
...
@@ -522,18 +522,13 @@ a filler b
4 zz 4
5 qq 4
must use union, not sort-union:
explain select * from t2 where a=
4 or b=4
;
explain select * from t2 where a=
2 or b=2
;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2
ALL a,b NULL NULL NULL #
Using where
select * from t2 where a=
4 or b=4
;
1 SIMPLE t2
index_merge a,b a,b 5,5 NULL # Using union(a,b);
Using where
select * from t2 where a=
2 or b=2
;
a filler b
4 4 0
4 5 0
4 filler 4
4 filler 4
4 qq 5
4 zz 4
5 qq 4
2 filler 2
2 filler 2
drop table t1, t2;
CREATE TABLE t1 (a varchar(8), b set('a','b','c','d','e','f','g','h'),
KEY b(b), KEY a(a));
...
...
mysql-test/main/innodb_ext_key.result
View file @
ccce4d3b
...
...
@@ -824,8 +824,8 @@ set optimizer_switch='extended_keys=off';
explain
select * from t1, t2 where t2.a=t1.a and t2.b < 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL
10
1 SIMPLE t2 eq_ref a a 4 test.t1.a
1
Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL
#
1 SIMPLE t2 eq_ref a a 4 test.t1.a
#
Using where
flush status;
select * from t1, t2 where t2.a=t1.a and t2.b < 2;
a pk a b
...
...
@@ -846,8 +846,8 @@ set optimizer_switch='extended_keys=on';
explain
select * from t1, t2 where t2.a=t1.a and t2.b < 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL
10
1 SIMPLE t2 eq_ref a a 4 test.t1.a
1
Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL
#
1 SIMPLE t2 eq_ref a a 4 test.t1.a
#
Using where
flush status;
select * from t1, t2 where t2.a=t1.a and t2.b < 2;
a pk a b
...
...
mysql-test/main/innodb_ext_key.test
View file @
ccce4d3b
...
...
@@ -497,6 +497,7 @@ select
from
t1
A
,
t1
B
;
set
optimizer_switch
=
'extended_keys=off'
;
--
replace_column
9
#
explain
select
*
from
t1
,
t2
where
t2
.
a
=
t1
.
a
and
t2
.
b
<
2
;
flush
status
;
...
...
@@ -504,6 +505,7 @@ select * from t1, t2 where t2.a=t1.a and t2.b < 2;
show
status
like
'handler_read%'
;
set
optimizer_switch
=
'extended_keys=on'
;
--
replace_column
9
#
explain
select
*
from
t1
,
t2
where
t2
.
a
=
t1
.
a
and
t2
.
b
<
2
;
flush
status
;
...
...
mysql-test/main/subselect_sj2.result
View file @
ccce4d3b
...
...
@@ -815,10 +815,10 @@ explain
SELECT * FROM t3
WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1.f13 = 24);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 const PRIMARY PRIMARY 4 const
1
Using index
1 PRIMARY alias2 index f12 f12 7 NULL
1
Using index; LooseScan
1 PRIMARY t1 index NULL PRIMARY 4 NULL
2
Using index; FirstMatch(alias2)
1 PRIMARY t3 ALL NULL NULL NULL NULL
7
Using where; Using join buffer (flat, BNL join)
1 PRIMARY alias1 const PRIMARY PRIMARY 4 const
#
Using index
1 PRIMARY alias2 index f12 f12 7 NULL
#
Using index; LooseScan
1 PRIMARY t1 index NULL PRIMARY 4 NULL
#
Using index; FirstMatch(alias2)
1 PRIMARY t3 ALL NULL NULL NULL NULL
#
Using where; Using join buffer (flat, BNL join)
SELECT * FROM t3
WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1.f13 = 24);
f12
...
...
mysql-test/main/subselect_sj2.test
View file @
ccce4d3b
...
...
@@ -995,6 +995,8 @@ CREATE TABLE t3 (f12 varchar(1) NOT NULL) ENGINE=InnoDB;
INSERT
INTO
t3
VALUES
(
'r'
),(
's'
),(
't'
),(
'v'
),(
'w'
),(
'x'
),(
'y'
);
--
echo
# The following must use LooseScan but not join buffering
--
replace_column
9
#
explain
SELECT
*
FROM
t3
WHERE
f12
IN
(
SELECT
alias2
.
f12
FROM
t1
AS
alias1
,
t2
AS
alias2
,
t1
WHERE
alias1
.
f13
=
24
);
...
...
mysql-test/main/subselect_sj2_jcl6.result
View file @
ccce4d3b
...
...
@@ -831,10 +831,10 @@ explain
SELECT * FROM t3
WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1.f13 = 24);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 const PRIMARY PRIMARY 4 const
1
Using index
1 PRIMARY alias2 index f12 f12 7 NULL
1
Using index; LooseScan
1 PRIMARY t1 index NULL PRIMARY 4 NULL
2
Using index; FirstMatch(alias2)
1 PRIMARY t3 ALL NULL NULL NULL NULL
7
Using where; Using join buffer (flat, BNL join)
1 PRIMARY alias1 const PRIMARY PRIMARY 4 const
#
Using index
1 PRIMARY alias2 index f12 f12 7 NULL
#
Using index; LooseScan
1 PRIMARY t1 index NULL PRIMARY 4 NULL
#
Using index; FirstMatch(alias2)
1 PRIMARY t3 ALL NULL NULL NULL NULL
#
Using where; Using join buffer (flat, BNL join)
SELECT * FROM t3
WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1.f13 = 24);
f12
...
...
mysql-test/main/subselect_sj2_mat.result
View file @
ccce4d3b
...
...
@@ -817,10 +817,10 @@ explain
SELECT * FROM t3
WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1.f13 = 24);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 const PRIMARY PRIMARY 4 const
1
Using index
1 PRIMARY alias2 index f12 f12 7 NULL
1
Using index; LooseScan
1 PRIMARY t1 index NULL PRIMARY 4 NULL
2
Using index; FirstMatch(alias2)
1 PRIMARY t3 ALL NULL NULL NULL NULL
7
Using where; Using join buffer (flat, BNL join)
1 PRIMARY alias1 const PRIMARY PRIMARY 4 const
#
Using index
1 PRIMARY alias2 index f12 f12 7 NULL
#
Using index; LooseScan
1 PRIMARY t1 index NULL PRIMARY 4 NULL
#
Using index; FirstMatch(alias2)
1 PRIMARY t3 ALL NULL NULL NULL NULL
#
Using where; Using join buffer (flat, BNL join)
SELECT * FROM t3
WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1.f13 = 24);
f12
...
...
sql/rowid_filter.cc
View file @
ccce4d3b
...
...
@@ -189,8 +189,6 @@ int compare_range_rowid_filter_cost_info_by_a(
void
TABLE
::
prune_range_rowid_filters
()
{
uint
i
,
j
;
/*
For the elements of the array with cost info on range filters
build a bit matrix of absolutely independent elements.
...
...
@@ -201,11 +199,15 @@ void TABLE::prune_range_rowid_filters()
*/
Range_rowid_filter_cost_info
**
filter_ptr_1
=
range_rowid_filter_cost_info_ptr
;
for
(
i
=
0
;
i
<
range_rowid_filter_cost_info_elems
;
i
++
,
filter_ptr_1
++
)
for
(
uint
i
=
0
;
i
<
range_rowid_filter_cost_info_elems
;
i
++
,
filter_ptr_1
++
)
{
uint
key_no
=
(
*
filter_ptr_1
)
->
key_no
;
Range_rowid_filter_cost_info
**
filter_ptr_2
=
filter_ptr_1
+
1
;
for
(
j
=
i
+
1
;
j
<
range_rowid_filter_cost_info_elems
;
j
++
,
filter_ptr_2
++
)
for
(
uint
j
=
i
+
1
;
j
<
range_rowid_filter_cost_info_elems
;
j
++
,
filter_ptr_2
++
)
{
key_map
map_1
=
key_info
[
key_no
].
overlapped
;
map_1
.
merge
(
key_info
[
key_no
].
constraint_correlated
);
...
...
@@ -236,7 +238,9 @@ void TABLE::prune_range_rowid_filters()
Range_rowid_filter_cost_info
**
cand_filter_ptr
=
range_rowid_filter_cost_info_ptr
;
for
(
i
=
0
;
i
<
range_rowid_filter_cost_info_elems
;
i
++
,
cand_filter_ptr
++
)
for
(
uint
i
=
0
;
i
<
range_rowid_filter_cost_info_elems
;
i
++
,
cand_filter_ptr
++
)
{
bool
is_pruned
=
false
;
Range_rowid_filter_cost_info
**
usable_filter_ptr
=
...
...
sql/rowid_filter.h
View file @
ccce4d3b
...
...
@@ -153,7 +153,7 @@ class Range_rowid_filter_cost_info;
typedef
enum
{
SORTED_ARRAY_CONTAINER
,
BLOOM_FILTER_CONTAINER
BLOOM_FILTER_CONTAINER
// Not used yet
}
Rowid_filter_container_type
;
/**
...
...
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