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
90e87293
Commit
90e87293
authored
May 15, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimising UNION ALL (WL 1687)
parent
c6bc3cfb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
sql/sql_union.cc
sql/sql_union.cc
+7
-3
No files found.
sql/sql_union.cc
View file @
90e87293
...
...
@@ -339,8 +339,8 @@ int st_select_lex_unit::exec()
item
->
reset
();
table
->
file
->
delete_all_rows
();
}
if
(
union_distinct
)
// for subselects
table
->
file
->
extra
(
HA_EXTRA_CHANGE_KEY_TO_UNIQUE
);
if
(
union_distinct
&&
table
->
file
->
enable_indexes
(
HA_KEY_SWITCH_ALL
))
DBUG_RETURN
(
1
);
// For sub-selects
for
(
SELECT_LEX
*
sl
=
select_cursor
;
sl
;
sl
=
sl
->
next_select
())
{
ha_rows
records_at_start
=
0
;
...
...
@@ -392,7 +392,11 @@ int st_select_lex_unit::exec()
records_at_start
=
table
->
file
->
records
;
sl
->
join
->
exec
();
if
(
sl
==
union_distinct
)
table
->
file
->
extra
(
HA_EXTRA_CHANGE_KEY_TO_DUP
);
{
if
(
table
->
file
->
disable_indexes
(
HA_KEY_SWITCH_ALL
))
DBUG_RETURN
(
1
);
table
->
no_keyread
=
1
;
}
res
=
sl
->
join
->
error
;
offset_limit_cnt
=
sl
->
offset_limit
;
if
(
!
res
&&
union_result
->
flush
())
...
...
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