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
de5f7348
Commit
de5f7348
authored
Sep 02, 2019
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make main.subselect_sj2* tests stable
Use EITS statistics to avoid changing query plans
parent
b1e37799
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
24 deletions
+75
-24
mysql-test/main/subselect_sj2.result
mysql-test/main/subselect_sj2.result
+24
-8
mysql-test/main/subselect_sj2.test
mysql-test/main/subselect_sj2.test
+3
-0
mysql-test/main/subselect_sj2_jcl6.result
mysql-test/main/subselect_sj2_jcl6.result
+24
-8
mysql-test/main/subselect_sj2_mat.result
mysql-test/main/subselect_sj2_mat.result
+24
-8
No files found.
mysql-test/main/subselect_sj2.result
View file @
de5f7348
...
@@ -813,6 +813,14 @@ CREATE TABLE t2 (f14 int(11) NOT NULL, f12 varchar(1) NOT NULL, KEY (f12,f14)) E
...
@@ -813,6 +813,14 @@ CREATE TABLE t2 (f14 int(11) NOT NULL, f12 varchar(1) NOT NULL, KEY (f12,f14)) E
INSERT INTO t2 VALUES (6,'y');
INSERT INTO t2 VALUES (6,'y');
CREATE TABLE t3 (f12 varchar(1) NOT NULL) ENGINE=InnoDB;
CREATE TABLE t3 (f12 varchar(1) NOT NULL) ENGINE=InnoDB;
INSERT INTO t3 VALUES ('r'),('s'),('t'),('v'),('w'),('x'),('y');
INSERT INTO t3 VALUES ('r'),('s'),('t'),('v'),('w'),('x'),('y');
analyze table t1,t2,t3 persistent for all;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
test.t3 analyze status Engine-independent statistics collected
test.t3 analyze status OK
# The following must use LooseScan but not join buffering
# The following must use LooseScan but not join buffering
explain
explain
SELECT * FROM t3
SELECT * FROM t3
...
@@ -1102,6 +1110,14 @@ INSERT INTO t2 VALUES
...
@@ -1102,6 +1110,14 @@ INSERT INTO t2 VALUES
(9,'d','d'),(10,'s','s'),(11,'r','r'),(12,'m','m'),
(9,'d','d'),(10,'s','s'),(11,'r','r'),(12,'m','m'),
(13,'b','b'),(14,'x','x'),(15,'g','g'),(16,'p','p'),
(13,'b','b'),(14,'x','x'),(15,'g','g'),(16,'p','p'),
(17,'q','q'),(18,'w','w'),(19,'d','d');
(17,'q','q'),(18,'w','w'),(19,'d','d');
analyze table t1 persistent for all;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
analyze table t2 persistent for all;
Table Op Msg_type Msg_text
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
EXPLAIN
EXPLAIN
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
WHERE alias3.d IN (
WHERE alias3.d IN (
...
@@ -1110,11 +1126,11 @@ WHERE alias5.b = alias4.b
...
@@ -1110,11 +1126,11 @@ WHERE alias5.b = alias4.b
AND ( alias5.b >= alias3.b OR alias5.c != alias3.c )
AND ( alias5.b >= alias3.b OR alias5.c != alias3.c )
);
);
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL #
1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL # Using where
1 PRIMARY alias5 index PRIMARY c 4 NULL # Using where; Using index
1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d # Using index
1 PRIMARY alias4 eq_ref PRIMARY,c PRIMARY 4 test.alias5.b # Using where; FirstMatch(alias3)
1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using where; FirstMatch(alias3)
1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
WHERE alias3.d IN (
WHERE alias3.d IN (
SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
...
@@ -1131,11 +1147,11 @@ WHERE alias5.b = alias4.b
...
@@ -1131,11 +1147,11 @@ WHERE alias5.b = alias4.b
AND ( alias5.b >= alias3.b OR alias3.c != alias5.c )
AND ( alias5.b >= alias3.b OR alias3.c != alias5.c )
);
);
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL #
1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL # Using where
1 PRIMARY alias5 index PRIMARY c 4 NULL # Using where; Using index
1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d # Using index
1 PRIMARY alias4 eq_ref PRIMARY,c PRIMARY 4 test.alias5.b # Using where; FirstMatch(alias3)
1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using where; FirstMatch(alias3)
1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
WHERE alias3.d IN (
WHERE alias3.d IN (
SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
...
...
mysql-test/main/subselect_sj2.test
View file @
de5f7348
...
@@ -994,6 +994,7 @@ INSERT INTO t2 VALUES (6,'y');
...
@@ -994,6 +994,7 @@ INSERT INTO t2 VALUES (6,'y');
CREATE
TABLE
t3
(
f12
varchar
(
1
)
NOT
NULL
)
ENGINE
=
InnoDB
;
CREATE
TABLE
t3
(
f12
varchar
(
1
)
NOT
NULL
)
ENGINE
=
InnoDB
;
INSERT
INTO
t3
VALUES
(
'r'
),(
's'
),(
't'
),(
'v'
),(
'w'
),(
'x'
),(
'y'
);
INSERT
INTO
t3
VALUES
(
'r'
),(
's'
),(
't'
),(
'v'
),(
'w'
),(
'x'
),(
'y'
);
analyze
table
t1
,
t2
,
t3
persistent
for
all
;
--
echo
# The following must use LooseScan but not join buffering
--
echo
# The following must use LooseScan but not join buffering
--
replace_column
9
#
--
replace_column
9
#
...
@@ -1225,6 +1226,8 @@ INSERT INTO t2 VALUES
...
@@ -1225,6 +1226,8 @@ INSERT INTO t2 VALUES
(
13
,
'b'
,
'b'
),(
14
,
'x'
,
'x'
),(
15
,
'g'
,
'g'
),(
16
,
'p'
,
'p'
),
(
13
,
'b'
,
'b'
),(
14
,
'x'
,
'x'
),(
15
,
'g'
,
'g'
),(
16
,
'p'
,
'p'
),
(
17
,
'q'
,
'q'
),(
18
,
'w'
,
'w'
),(
19
,
'd'
,
'd'
);
(
17
,
'q'
,
'q'
),(
18
,
'w'
,
'w'
),(
19
,
'd'
,
'd'
);
analyze
table
t1
persistent
for
all
;
analyze
table
t2
persistent
for
all
;
--
replace_column
9
#
--
replace_column
9
#
EXPLAIN
EXPLAIN
SELECT
COUNT
(
*
)
FROM
t1
AS
alias1
,
t1
AS
alias2
,
t2
AS
alias3
SELECT
COUNT
(
*
)
FROM
t1
AS
alias1
,
t1
AS
alias2
,
t2
AS
alias3
...
...
mysql-test/main/subselect_sj2_jcl6.result
View file @
de5f7348
...
@@ -826,6 +826,14 @@ CREATE TABLE t2 (f14 int(11) NOT NULL, f12 varchar(1) NOT NULL, KEY (f12,f14)) E
...
@@ -826,6 +826,14 @@ CREATE TABLE t2 (f14 int(11) NOT NULL, f12 varchar(1) NOT NULL, KEY (f12,f14)) E
INSERT INTO t2 VALUES (6,'y');
INSERT INTO t2 VALUES (6,'y');
CREATE TABLE t3 (f12 varchar(1) NOT NULL) ENGINE=InnoDB;
CREATE TABLE t3 (f12 varchar(1) NOT NULL) ENGINE=InnoDB;
INSERT INTO t3 VALUES ('r'),('s'),('t'),('v'),('w'),('x'),('y');
INSERT INTO t3 VALUES ('r'),('s'),('t'),('v'),('w'),('x'),('y');
analyze table t1,t2,t3 persistent for all;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
test.t3 analyze status Engine-independent statistics collected
test.t3 analyze status OK
# The following must use LooseScan but not join buffering
# The following must use LooseScan but not join buffering
explain
explain
SELECT * FROM t3
SELECT * FROM t3
...
@@ -1115,6 +1123,14 @@ INSERT INTO t2 VALUES
...
@@ -1115,6 +1123,14 @@ INSERT INTO t2 VALUES
(9,'d','d'),(10,'s','s'),(11,'r','r'),(12,'m','m'),
(9,'d','d'),(10,'s','s'),(11,'r','r'),(12,'m','m'),
(13,'b','b'),(14,'x','x'),(15,'g','g'),(16,'p','p'),
(13,'b','b'),(14,'x','x'),(15,'g','g'),(16,'p','p'),
(17,'q','q'),(18,'w','w'),(19,'d','d');
(17,'q','q'),(18,'w','w'),(19,'d','d');
analyze table t1 persistent for all;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
analyze table t2 persistent for all;
Table Op Msg_type Msg_text
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
EXPLAIN
EXPLAIN
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
WHERE alias3.d IN (
WHERE alias3.d IN (
...
@@ -1123,11 +1139,11 @@ WHERE alias5.b = alias4.b
...
@@ -1123,11 +1139,11 @@ WHERE alias5.b = alias4.b
AND ( alias5.b >= alias3.b OR alias5.c != alias3.c )
AND ( alias5.b >= alias3.b OR alias5.c != alias3.c )
);
);
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL #
1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL # Using where
1 PRIMARY alias5 index PRIMARY c 4 NULL # Using where; Using index; Using join buffer (flat, BNL join)
1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d # Using index
1 PRIMARY alias4 eq_ref PRIMARY,c PRIMARY 4 test.alias5.b # Using where; FirstMatch(alias3); Using join buffer (incremental, BKA join); Key-ordered scan
1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using where; FirstMatch(alias3)
1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join)
1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join)
1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join)
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
WHERE alias3.d IN (
WHERE alias3.d IN (
SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
...
@@ -1144,11 +1160,11 @@ WHERE alias5.b = alias4.b
...
@@ -1144,11 +1160,11 @@ WHERE alias5.b = alias4.b
AND ( alias5.b >= alias3.b OR alias3.c != alias5.c )
AND ( alias5.b >= alias3.b OR alias3.c != alias5.c )
);
);
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL #
1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL # Using where
1 PRIMARY alias5 index PRIMARY c 4 NULL # Using where; Using index; Using join buffer (flat, BNL join)
1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d # Using index
1 PRIMARY alias4 eq_ref PRIMARY,c PRIMARY 4 test.alias5.b # Using where; FirstMatch(alias3); Using join buffer (incremental, BKA join); Key-ordered scan
1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using where; FirstMatch(alias3)
1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join)
1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join)
1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join)
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
WHERE alias3.d IN (
WHERE alias3.d IN (
SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
...
...
mysql-test/main/subselect_sj2_mat.result
View file @
de5f7348
...
@@ -815,6 +815,14 @@ CREATE TABLE t2 (f14 int(11) NOT NULL, f12 varchar(1) NOT NULL, KEY (f12,f14)) E
...
@@ -815,6 +815,14 @@ CREATE TABLE t2 (f14 int(11) NOT NULL, f12 varchar(1) NOT NULL, KEY (f12,f14)) E
INSERT INTO t2 VALUES (6,'y');
INSERT INTO t2 VALUES (6,'y');
CREATE TABLE t3 (f12 varchar(1) NOT NULL) ENGINE=InnoDB;
CREATE TABLE t3 (f12 varchar(1) NOT NULL) ENGINE=InnoDB;
INSERT INTO t3 VALUES ('r'),('s'),('t'),('v'),('w'),('x'),('y');
INSERT INTO t3 VALUES ('r'),('s'),('t'),('v'),('w'),('x'),('y');
analyze table t1,t2,t3 persistent for all;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
test.t3 analyze status Engine-independent statistics collected
test.t3 analyze status OK
# The following must use LooseScan but not join buffering
# The following must use LooseScan but not join buffering
explain
explain
SELECT * FROM t3
SELECT * FROM t3
...
@@ -1104,6 +1112,14 @@ INSERT INTO t2 VALUES
...
@@ -1104,6 +1112,14 @@ INSERT INTO t2 VALUES
(9,'d','d'),(10,'s','s'),(11,'r','r'),(12,'m','m'),
(9,'d','d'),(10,'s','s'),(11,'r','r'),(12,'m','m'),
(13,'b','b'),(14,'x','x'),(15,'g','g'),(16,'p','p'),
(13,'b','b'),(14,'x','x'),(15,'g','g'),(16,'p','p'),
(17,'q','q'),(18,'w','w'),(19,'d','d');
(17,'q','q'),(18,'w','w'),(19,'d','d');
analyze table t1 persistent for all;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
analyze table t2 persistent for all;
Table Op Msg_type Msg_text
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
EXPLAIN
EXPLAIN
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
WHERE alias3.d IN (
WHERE alias3.d IN (
...
@@ -1112,11 +1128,11 @@ WHERE alias5.b = alias4.b
...
@@ -1112,11 +1128,11 @@ WHERE alias5.b = alias4.b
AND ( alias5.b >= alias3.b OR alias5.c != alias3.c )
AND ( alias5.b >= alias3.b OR alias5.c != alias3.c )
);
);
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL #
1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL # Using where
1 PRIMARY alias5 index PRIMARY c 4 NULL # Using where; Using index
1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d # Using index
1 PRIMARY alias4 eq_ref PRIMARY,c PRIMARY 4 test.alias5.b # Using where; FirstMatch(alias3)
1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using where; FirstMatch(alias3)
1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
WHERE alias3.d IN (
WHERE alias3.d IN (
SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
...
@@ -1133,11 +1149,11 @@ WHERE alias5.b = alias4.b
...
@@ -1133,11 +1149,11 @@ WHERE alias5.b = alias4.b
AND ( alias5.b >= alias3.b OR alias3.c != alias5.c )
AND ( alias5.b >= alias3.b OR alias3.c != alias5.c )
);
);
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL #
1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL # Using where
1 PRIMARY alias5 index PRIMARY c 4 NULL # Using where; Using index
1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d # Using index
1 PRIMARY alias4 eq_ref PRIMARY,c PRIMARY 4 test.alias5.b # Using where; FirstMatch(alias3)
1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using where; FirstMatch(alias3)
1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
WHERE alias3.d IN (
WHERE alias3.d IN (
SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
SELECT alias4.c FROM t2 AS alias4, t2 AS alias5
...
...
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