Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.4.33, 10.6.17
-
None
Description
/*
|
Check whether the merging algorithm can be used for this unit
|
|
SYNOPSIS
|
st_select_lex_unit::can_be_merged()
|
|
DESCRIPTION
|
We can apply merge algorithm for a unit if it is single SELECT with
|
subqueries only in WHERE clauses or in ON conditions or in select list
|
(we do not count SELECTs of underlying views/derived tables/CTEs and
|
second level subqueries) and we have no grouping, ordering, HAVING
|
clause, aggregate functions, DISTINCT clause, LIMIT clause.
|
|
RETURN
|
FALSE - only temporary table algorithm can be used
|
TRUE - merge algorithm can be used
|
*/
|
|
bool st_select_lex_unit::can_be_merged() |
{
|
// TODO: do not forget implement case when select_lex.table_list.elements==0 |
|
The comment isn't quite right, but constant queries are always mergeable and may or may not be marked that way.