MySQL 9.3.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
finalize_plan.cc File Reference
#include "sql/join_optimizer/finalize_plan.h"
#include <assert.h>
#include <algorithm>
#include <functional>
#include "mem_root_deque.h"
#include "my_alloc.h"
#include "my_base.h"
#include "my_inttypes.h"
#include "my_sqlcommand.h"
#include "my_table_map.h"
#include "prealloced_array.h"
#include "sql/filesort.h"
#include "sql/item.h"
#include "sql/item_cmpfunc.h"
#include "sql/item_sum.h"
#include "sql/join_optimizer/access_path.h"
#include "sql/join_optimizer/bit_utils.h"
#include "sql/join_optimizer/join_optimizer.h"
#include "sql/join_optimizer/materialize_path_parameters.h"
#include "sql/join_optimizer/relational_expression.h"
#include "sql/join_optimizer/replace_item.h"
#include "sql/join_optimizer/walk_access_paths.h"
#include "sql/mem_root_array.h"
#include "sql/sql_class.h"
#include "sql/sql_const.h"
#include "sql/sql_executor.h"
#include "sql/sql_insert.h"
#include "sql/sql_lex.h"
#include "sql/sql_list.h"
#include "sql/sql_optimizer.h"
#include "sql/sql_resolver.h"
#include "sql/sql_select.h"
#include "sql/sql_tmp_table.h"
#include "sql/table.h"
#include "sql/temp_table_param.h"
#include "sql/visible_fields.h"
#include "sql/window.h"
#include "template_utils.h"

Namespaces

namespace  anonymous_namespace{finalize_plan.cc}
 

Functions

bool anonymous_namespace{finalize_plan.cc}::IsMaterializePathForDeduplication (AccessPath *path)
 
bool anonymous_namespace{finalize_plan.cc}::IsMaterializePathForDistinct (AccessPath *path)
 
bool anonymous_namespace{finalize_plan.cc}::IsMaterializePathForGroupBy (AccessPath *path)
 
bool anonymous_namespace{finalize_plan.cc}::HasVisibleBitItems (bool is_distinct, mem_root_deque< Item * > *distinct_items, bool is_group_by, ORDER *group)
 Search for visible BIT items, and return true if found. More...
 
void anonymous_namespace{finalize_plan.cc}::ReplaceUpdateValuesWithTempTableFields (Sql_cmd_insert_select *sql_cmd, Query_block *query_block, const mem_root_deque< Item * > &original_fields, const mem_root_deque< Item * > &temp_table_fields)
 Replaces field references in an ON DUPLICATE KEY UPDATE clause with references to corresponding fields in a temporary table. More...
 
void anonymous_namespace{finalize_plan.cc}::CollectItemsWithoutRollup (Item *root, mem_root_deque< Item * > *items)
 Collects the set of items in the item tree that satisfy the following: More...
 
TABLEanonymous_namespace{finalize_plan.cc}::CreateTemporaryTableFromSelectList (THD *thd, Query_block *query_block, Window *window, Temp_table_param **temp_table_param_arg, bool after_aggregation, bool is_group_by=false, bool is_distinct=false)
 Creates a temporary table with columns matching the SELECT list of the given query block. More...
 
void anonymous_namespace{finalize_plan.cc}::ReplaceSelectListWithTempTableFields (THD *thd, JOIN *join, const Func_ptr_array &items_to_copy, Mem_root_array< const Func_ptr_array * > *applied_replacements)
 Replaces the items in the SELECT list with items that point to fields in a temporary table. More...
 
bool anonymous_namespace{finalize_plan.cc}::InitTmpTableSliceRefs (THD *thd, AccessPath *path, JOIN *join)
 In hypergraph optimizer, slices are currently used only for temp tables created for GROUP BY; i.e. More...
 
void ReplaceOrderItemsWithTempTableFields (THD *thd, ORDER *order, const Func_ptr_array &items_to_copy)
 
table_map anonymous_namespace{finalize_plan.cc}::GetUsedTableMap (const ORDER *order)
 
bool anonymous_namespace{finalize_plan.cc}::OrderItemsReferenceUnavailableTables (const AccessPath *sort_path, table_map used_tables_before_replacement)
 Checks if the order items in a SORT access path reference any column that is not available to it. More...
 
Temp_table_paramanonymous_namespace{finalize_plan.cc}::GetItemsToCopy (AccessPath *path)
 
bool anonymous_namespace{finalize_plan.cc}::UpdateReferencesToMaterializedItems (THD *thd, Query_block *query_block, AccessPath *path, bool after_aggregation, Mem_root_array< const Func_ptr_array * > *applied_replacements)
 See FinalizePlanForQueryBlock(). More...
 
bool anonymous_namespace{finalize_plan.cc}::DelayedCreateTemporaryTable (THD *thd, Query_block *query_block, AccessPath *path, bool after_aggregation, TABLE **last_window_temp_table, unsigned *num_windows_seen)
 If the given access path needs a temporary table, it instantiates said table (we cannot do this until we have a final access path list, where we know which temporary tables are created and in which order). More...
 
void anonymous_namespace{finalize_plan.cc}::FinalizeWindowPath (THD *thd, Query_block *query_block, const mem_root_deque< Item * > &original_fields, const Mem_root_array< const Func_ptr_array * > &applied_replacements, AccessPath *path)
 See FinalizePlanForQueryBlock(). More...
 
Itemanonymous_namespace{finalize_plan.cc}::AddCachesAroundConstantConditions (Item *item)
 
bool anonymous_namespace{finalize_plan.cc}::AddCachesAroundConstantConditionsInPath (AccessPath *path)
 
void anonymous_namespace{finalize_plan.cc}::FinalizeUpdateOrDelete (AccessPath *root_path, table_map target_tables)
 Perform finalization specific to UPDATE and DELETE access paths. More...
 
void anonymous_namespace{finalize_plan.cc}::FinalizeSortPaths (THD *thd, AccessPath *root_path, JOIN *join)
 Create Filesort objects for all SORT access paths in a query block. More...
 
bool FinalizePlanForQueryBlock (THD *thd, Query_block *query_block)
 

Function Documentation

◆ FinalizePlanForQueryBlock()

bool FinalizePlanForQueryBlock ( THD thd,
Query_block query_block 
)

◆ ReplaceOrderItemsWithTempTableFields()

void ReplaceOrderItemsWithTempTableFields ( THD thd,
ORDER order,
const Func_ptr_array items_to_copy 
)