MySQL 8.4.3
Source Code Documentation
|
Compute an IN predicate via a hash semi-join. More...
#include <item_subselect.h>
Public Member Functions | |
subselect_hash_sj_engine (Item_in_subselect *in_predicate, Query_expression *query_expr) | |
~subselect_hash_sj_engine () override | |
bool | setup (THD *thd, const mem_root_deque< Item * > &tmp_columns) |
Create all structures needed for subquery execution using hash semijoin. More... | |
void | cleanup () override |
Cleanup performed after each execution. More... | |
bool | exec (THD *thd) override |
Execute a subquery IN predicate via materialization. More... | |
void | print (const THD *thd, String *str, enum_query_type query_type) override |
Print the state of this engine into a string for debugging and views. More... | |
enum_engine_type | engine_type () const override |
TABLE * | get_table () const |
const Index_lookup & | index_lookup () const |
enum join_type | get_join_type () const |
AccessPath * | root_access_path () const |
void | create_iterators (THD *thd) override |
Public Member Functions inherited from subselect_indexsubquery_engine | |
subselect_indexsubquery_engine (TABLE *table, Table_ref *table_ref, const Index_lookup &ref, enum join_type join_type, Item_in_subselect *subs, Item *where, Item *having) | |
virtual | ~subselect_indexsubquery_engine ()=default |
Private Types | |
enum | nulls_exist { NEX_IRRELEVANT_OR_FALSE = 0 , NEX_UNKNOWN = 1 , NEX_TRUE = 2 } |
Existence of inner NULLs in materialized table: By design, other values than IRRELEVANT_OR_FALSE are possible only if the subquery has only one inner expression. More... | |
Private Attributes | |
bool | is_materialized |
bool | has_zero_rows = false |
enum nulls_exist | mat_table_has_nulls |
Query_expression *const | m_query_expr |
unique_ptr_destroy_only< RowIterator > | m_iterator |
AccessPath * | m_root_access_path |
Query_result_interceptor * | saved_result {nullptr} |
Saved result object, must be restored after use. More... | |
Additional Inherited Members | |
Public Types inherited from subselect_indexsubquery_engine | |
enum | enum_engine_type { INDEXSUBQUERY_ENGINE , HASH_SJ_ENGINE } |
Protected Attributes inherited from subselect_indexsubquery_engine | |
Query_result_union * | result = nullptr |
TABLE * | table {nullptr} |
Table which is read, using one of eq_ref, ref, ref_or_null. More... | |
Table_ref * | table_ref {nullptr} |
Index_lookup | ref |
join_type | type {JT_UNKNOWN} |
Item * | m_cond |
The WHERE condition of the subquery. More... | |
ulonglong | m_hash |
Hash value calculated by RefIterator, when needed. More... | |
Item * | m_having |
Item_in_subselect * | item |
Compute an IN predicate via a hash semi-join.
The subquery is materialized during the first evaluation of the IN predicate. The IN predicate is executed via the functionality inherited from subselect_indexsubquery_engine.
|
private |
Existence of inner NULLs in materialized table: By design, other values than IRRELEVANT_OR_FALSE are possible only if the subquery has only one inner expression.
Enumerator | |
---|---|
NEX_IRRELEVANT_OR_FALSE | none, or they don't matter |
NEX_UNKNOWN | they matter, and we don't know yet if they exists |
NEX_TRUE | they matter, and we know there exists at least one. |
|
inline |
|
override |
|
overridevirtual |
Cleanup performed after each execution.
Reimplemented from subselect_indexsubquery_engine.
|
overridevirtual |
Reimplemented from subselect_indexsubquery_engine.
|
inlineoverridevirtual |
Reimplemented from subselect_indexsubquery_engine.
|
overridevirtual |
Execute a subquery IN predicate via materialization.
If needed materialize the subquery into a temporary table, then compute the predicate via a lookup into this table.
Reimplemented from subselect_indexsubquery_engine.
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Print the state of this engine into a string for debugging and views.
Reimplemented from subselect_indexsubquery_engine.
|
inline |
bool subselect_hash_sj_engine::setup | ( | THD * | thd, |
const mem_root_deque< Item * > & | tmp_columns | ||
) |
Create all structures needed for subquery execution using hash semijoin.
thd | thread handle |
tmp_columns | columns of temporary table |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Saved result object, must be restored after use.