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
dcc7f939
Commit
dcc7f939
authored
Dec 11, 2020
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-21958: Query having many NOT-IN clauses running forever, part 3
Add the new file
parent
502bc77f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
0 deletions
+64
-0
mysql-test/main/range_notembedded.result
mysql-test/main/range_notembedded.result
+31
-0
mysql-test/main/range_notembedded.test
mysql-test/main/range_notembedded.test
+33
-0
No files found.
mysql-test/main/range_notembedded.result
0 → 100644
View file @
dcc7f939
drop table if exists t1,t2;
#
# MDEV-21958: Query having many NOT-IN clauses running forever
#
create table t2 (
pk int primary key,
key1 int,
col1 int,
key (key1, pk)
);
insert into t2 (pk, key1) values (1,1),(2,2),(3,3),(4,4),(5,5);
set @tmp_21958=@@optimizer_trace;
set optimizer_trace=1;
explain select * from t2 where key1 in (1,2,3) and pk not in (1,2,3);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL PRIMARY,key1 NULL NULL NULL 5 Using where
# This should show only ranges in form "(1) <= (key1) <= (1)"
# ranges over "pk" should not be constructed.
select json_detailed(JSON_EXTRACT(trace, '$**.ranges'))
from information_schema.optimizer_trace;
json_detailed(JSON_EXTRACT(trace, '$**.ranges'))
[
[
"(1) <= (key1) <= (1)",
"(2) <= (key1) <= (2)",
"(3) <= (key1) <= (3)"
]
]
set optimizer_trace=@tmp_21958;
drop table t2;
mysql-test/main/range_notembedded.test
0 → 100644
View file @
dcc7f939
#
# Range tests without embedded server.
# The first reason to have them is that embedded server doesn't have
# optimizer trace.
#
--
source
include
/
not_embedded
.
inc
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
--
echo
#
--
echo
# MDEV-21958: Query having many NOT-IN clauses running forever
--
echo
#
create
table
t2
(
pk
int
primary
key
,
key1
int
,
col1
int
,
key
(
key1
,
pk
)
);
insert
into
t2
(
pk
,
key1
)
values
(
1
,
1
),(
2
,
2
),(
3
,
3
),(
4
,
4
),(
5
,
5
);
set
@
tmp_21958
=@@
optimizer_trace
;
set
optimizer_trace
=
1
;
explain
select
*
from
t2
where
key1
in
(
1
,
2
,
3
)
and
pk
not
in
(
1
,
2
,
3
);
--
echo
# This should show only ranges in form "(1) <= (key1) <= (1)"
--
echo
# ranges over "pk" should not be constructed.
select
json_detailed
(
JSON_EXTRACT
(
trace
,
'$**.ranges'
))
from
information_schema
.
optimizer_trace
;
set
optimizer_trace
=@
tmp_21958
;
drop
table
t2
;
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