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
f5dceafd
Commit
f5dceafd
authored
Mar 29, 2023
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-30964: MAX_SEL_ARG memory exhaustion is not visible in the optimizer trace
Add printing
parent
2165c304
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
0 deletions
+81
-0
mysql-test/main/opt_trace.result
mysql-test/main/opt_trace.result
+41
-0
mysql-test/main/opt_trace.test
mysql-test/main/opt_trace.test
+33
-0
sql/opt_range.cc
sql/opt_range.cc
+7
-0
No files found.
mysql-test/main/opt_trace.result
View file @
f5dceafd
...
@@ -8515,6 +8515,47 @@ SELECT a FROM t1 WHERE (a,b) in (SELECT @c,@d);
...
@@ -8515,6 +8515,47 @@ SELECT a FROM t1 WHERE (a,b) in (SELECT @c,@d);
a
a
DROP TABLE t1;
DROP TABLE t1;
#
#
# MDEV-30964: MAX_SEL_ARG memory exhaustion is not visible in the optimizer trace
#
create table t1 (
c1 int,
c2 int,
c3 int,
c4 int,
c5 int,
c6 int,
c7 int,
c8 int,
key(c1,c2,c3,c4,c5,c6,c7,c8)
);
insert into t1 () values (),(),();
explain select *
from t1
where
(c1 in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) and c2=1) and
c3 in (1,2,3,4,5,6,7,8,9,10) and
c4 in (1,2,3,4,5,6,7,8,9,10) and
c5 in (1,2,3,4,5,6,7,8,9,10) and
c6 in (1,2,3,4);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index c1 c1 40 NULL 3 Using where; Using index
select
json_detailed(json_extract(trace, '$**.setup_range_conditions'))
from
information_schema.optimizer_trace;
json_detailed(json_extract(trace, '$**.setup_range_conditions'))
[
[
{
"sel_arg_alloc_limit_hit":
{
"alloced_sel_args": 16001
}
}
]
]
drop table t1;
#
# MDEV-31085: multi-update using view with optimizer trace enabled
# MDEV-31085: multi-update using view with optimizer trace enabled
#
#
SET SESSION optimizer_trace = 'enabled=on';
SET SESSION optimizer_trace = 'enabled=on';
...
...
mysql-test/main/opt_trace.test
View file @
f5dceafd
...
@@ -677,6 +677,39 @@ INSERT INTO t1 VALUES (0,0);
...
@@ -677,6 +677,39 @@ INSERT INTO t1 VALUES (0,0);
SELECT
a
FROM
t1
WHERE
(
a
,
b
)
in
(
SELECT
@
c
,
@
d
);
SELECT
a
FROM
t1
WHERE
(
a
,
b
)
in
(
SELECT
@
c
,
@
d
);
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-30964: MAX_SEL_ARG memory exhaustion is not visible in the optimizer trace
--
echo
#
create
table
t1
(
c1
int
,
c2
int
,
c3
int
,
c4
int
,
c5
int
,
c6
int
,
c7
int
,
c8
int
,
key
(
c1
,
c2
,
c3
,
c4
,
c5
,
c6
,
c7
,
c8
)
);
insert
into
t1
()
values
(),(),();
explain
select
*
from
t1
where
(
c1
in
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
)
and
c2
=
1
)
and
c3
in
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
)
and
c4
in
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
)
and
c5
in
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
)
and
c6
in
(
1
,
2
,
3
,
4
);
select
json_detailed
(
json_extract
(
trace
,
'$**.setup_range_conditions'
))
from
information_schema
.
optimizer_trace
;
drop
table
t1
;
--
echo
#
--
echo
#
--
echo
# MDEV-31085: multi-update using view with optimizer trace enabled
--
echo
# MDEV-31085: multi-update using view with optimizer trace enabled
--
echo
#
--
echo
#
...
...
sql/opt_range.cc
View file @
f5dceafd
...
@@ -2853,6 +2853,13 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
...
@@ -2853,6 +2853,13 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
Json_writer_array
trace_range_summary
(
thd
,
Json_writer_array
trace_range_summary
(
thd
,
"setup_range_conditions"
);
"setup_range_conditions"
);
tree
=
cond
->
get_mm_tree
(
&
param
,
&
cond
);
tree
=
cond
->
get_mm_tree
(
&
param
,
&
cond
);
if
(
thd
->
trace_started
()
&&
param
.
alloced_sel_args
>=
SEL_ARG
::
MAX_SEL_ARGS
)
{
Json_writer_object
wrapper
(
thd
);
Json_writer_object
obj
(
thd
,
"sel_arg_alloc_limit_hit"
);
obj
.
add
(
"alloced_sel_args"
,
param
.
alloced_sel_args
);
}
}
}
if
(
tree
)
if
(
tree
)
{
{
...
...
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