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
1d135003
Commit
1d135003
authored
Oct 29, 2009
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MWL#17: Table elimination
- add debug tests (were accidentally not pushed with the bulk of WL)
parent
664fa25e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
mysql-test/r/table_elim_debug.result
mysql-test/r/table_elim_debug.result
+22
-0
mysql-test/t/table_elim_debug.test
mysql-test/t/table_elim_debug.test
+27
-0
No files found.
mysql-test/r/table_elim_debug.result
0 → 100644
View file @
1d135003
drop table if exists t1, t2;
create table t1 (a int);
insert into t1 values (0),(1),(2),(3);
create table t2 (a int primary key, b int)
as select a, a as b from t1 where a in (1,2);
explain select t1.a from t1 left join t2 on t2.a=t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4
set optimizer_switch='table_elimination=off';
explain select t1.a from t1 left join t2 on t2.a=t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using index
set optimizer_switch='table_elimination=on';
explain select t1.a from t1 left join t2 on t2.a=t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4
set optimizer_switch='table_elimination=default';
explain select t1.a from t1 left join t2 on t2.a=t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4
drop table t1, t2;
mysql-test/t/table_elim_debug.test
0 → 100644
View file @
1d135003
#
# Table elimination (MWL#17) tests that need debug build
#
--
source
include
/
have_debug
.
inc
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
# Check if optimizer_switch works
create
table
t1
(
a
int
);
insert
into
t1
values
(
0
),(
1
),(
2
),(
3
);
create
table
t2
(
a
int
primary
key
,
b
int
)
as
select
a
,
a
as
b
from
t1
where
a
in
(
1
,
2
);
explain
select
t1
.
a
from
t1
left
join
t2
on
t2
.
a
=
t1
.
a
;
set
optimizer_switch
=
'table_elimination=off'
;
explain
select
t1
.
a
from
t1
left
join
t2
on
t2
.
a
=
t1
.
a
;
set
optimizer_switch
=
'table_elimination=on'
;
explain
select
t1
.
a
from
t1
left
join
t2
on
t2
.
a
=
t1
.
a
;
set
optimizer_switch
=
'table_elimination=default'
;
explain
select
t1
.
a
from
t1
left
join
t2
on
t2
.
a
=
t1
.
a
;
drop
table
t1
,
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