MySQL 9.0.0
Source Code Documentation
|
Object containing parameters used when creating and using temporary tables. More...
#include <temp_table_param.h>
Public Types | |
enum | { TTP_UNION_OR_TABLE , TTP_EXCEPT , TTP_INTERSECT } |
For INTERSECT and EXCEPT computation. More... | |
Public Member Functions | |
bool | needs_set_counter () |
The tempoary table rows need a counter to keep track of its duplicates: needed for EXCEPT and INTERSECT computation. More... | |
Temp_table_param (MEM_ROOT *mem_root= *THR_MALLOC) | |
Temp_table_param (MEM_ROOT *mem_root, const Temp_table_param &other) | |
Temp_table_param & | operator= (const Temp_table_param &other) |
void | cleanup () |
Public Attributes | |
Mem_root_array< Copy_field > | copy_fields |
uchar * | group_buff |
Func_ptr_array * | items_to_copy |
KEY * | keyinfo |
After temporary table creation, points to an index on the table created depending on the purpose of the table - grouping, duplicate elimination, etc. More... | |
ha_rows | end_write_records {HA_POS_ERROR} |
LIMIT (maximum number of rows) for this temp table, or HA_POS_ERROR for no limit. More... | |
uint | func_count |
Number of items in the query. More... | |
uint | sum_func_count |
Number of fields in the query that have aggregate functions. More... | |
uint | hidden_field_count |
uint | group_parts |
uint | group_length |
uint | group_null_parts |
bool | allow_group_via_temp_table {true} |
Whether we allow running GROUP BY processing into a temporary table, i.e., keeping many different aggregations going at once without having ordered input. More... | |
uint | outer_sum_func_count |
Number of outer_sum_funcs i.e the number of set functions that are aggregated in a query block outer to this subquery. More... | |
bool | using_outer_summary_function |
Enabled when we have at least one outer_sum_func. More... | |
CHARSET_INFO * | table_charset |
bool | schema_table |
bool | precomputed_group_by |
bool | force_copy_fields |
bool | skip_create_table |
true <=> don't actually create table handler when creating the result table. More... | |
bool | bit_fields_as_long |
bool | can_use_pk_for_unique |
Whether the UNIQUE index can be promoted to PK. More... | |
bool | force_hash_field_for_unique {false} |
Whether UNIQUE keys should always be implemented by way of a hidden hash field, never a unique index. More... | |
bool | m_window_frame_buffer {false} |
This tmp table is used for a window's frame buffer. More... | |
enum Temp_table_param:: { ... } | TTP_UNION_OR_TABLE |
For INTERSECT and EXCEPT computation. More... | |
bool | m_last_operation_is_distinct {false} |
For INTERSECT and EXCEPT computation. More... | |
Window * | m_window |
If this is the out table of a window: the said window. More... | |
Object containing parameters used when creating and using temporary tables.
Temporary tables created with the help of this object are used only internally by the query execution engine.
anonymous enum |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
The tempoary table rows need a counter to keep track of its duplicates: needed for EXCEPT and INTERSECT computation.
|
inline |
bool Temp_table_param::allow_group_via_temp_table {true} |
Whether we allow running GROUP BY processing into a temporary table, i.e., keeping many different aggregations going at once without having ordered input.
This is usually the case, but is currently not supported for aggregation UDFs, aggregates with DISTINCT, or ROLLUP.
Note that even if this is true, the optimizer may choose to not use a temporary table, as it is often more efficient to just read along an index.
bool Temp_table_param::bit_fields_as_long |
bool Temp_table_param::can_use_pk_for_unique |
Whether the UNIQUE index can be promoted to PK.
Mem_root_array<Copy_field> Temp_table_param::copy_fields |
ha_rows Temp_table_param::end_write_records {HA_POS_ERROR} |
LIMIT (maximum number of rows) for this temp table, or HA_POS_ERROR for no limit.
Enforced by MaterializeIterator when writing to the table.
bool Temp_table_param::force_copy_fields |
bool Temp_table_param::force_hash_field_for_unique {false} |
Whether UNIQUE keys should always be implemented by way of a hidden hash field, never a unique index.
Needed for materialization of mixed UNION ALL / UNION DISTINCT queries (see comments in create_result_table()) and for DISTINCT deduplication using materialization (See CreateTemporaryTableFromSelectList()).
uint Temp_table_param::func_count |
Number of items in the query.
Includes both aggregate functions (e.g., SUM), and non-aggregates (e.g., RAND), window functions and fields. Also counts functions referred to from windowing or aggregate functions, i.e., "SELECT SUM(RAND())" sets this counter to 2.
uchar* Temp_table_param::group_buff |
uint Temp_table_param::group_length |
uint Temp_table_param::group_null_parts |
uint Temp_table_param::group_parts |
uint Temp_table_param::hidden_field_count |
Func_ptr_array* Temp_table_param::items_to_copy |
KEY* Temp_table_param::keyinfo |
After temporary table creation, points to an index on the table created depending on the purpose of the table - grouping, duplicate elimination, etc.
There is at most one such index.
bool Temp_table_param::m_last_operation_is_distinct {false} |
For INTERSECT and EXCEPT computation.
Cf. TABLE::m_last_operation_is_distinct.
Window* Temp_table_param::m_window |
If this is the out table of a window: the said window.
bool Temp_table_param::m_window_frame_buffer {false} |
This tmp table is used for a window's frame buffer.
uint Temp_table_param::outer_sum_func_count |
Number of outer_sum_funcs i.e the number of set functions that are aggregated in a query block outer to this subquery.
bool Temp_table_param::precomputed_group_by |
bool Temp_table_param::schema_table |
bool Temp_table_param::skip_create_table |
true <=> don't actually create table handler when creating the result table.
This allows range optimizer to add indexes later. Used for materialized derived tables/views.
uint Temp_table_param::sum_func_count |
Number of fields in the query that have aggregate functions.
Note that the optimizer may choose to optimize away these fields by replacing them with constants, in which case sum_func_count will need to be updated.
CHARSET_INFO* Temp_table_param::table_charset |
enum { ... } Temp_table_param::TTP_UNION_OR_TABLE |
For INTERSECT and EXCEPT computation.
bool Temp_table_param::using_outer_summary_function |
Enabled when we have at least one outer_sum_func.
Needed when used along with distinct.