MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
subselect_hash_sj_engine Class Reference

#include <item_subselect.h>

Inheritance diagram for subselect_hash_sj_engine:
Collaboration diagram for subselect_hash_sj_engine:

Public Member Functions

 subselect_hash_sj_engine (THD *thd, Item_subselect *in_predicate, subselect_single_select_engine *old_engine)
bool setup (List< Item > *tmp_columns)
virtual void cleanup ()
virtual bool prepare ()
virtual bool exec ()
virtual void print (String *str, enum_query_type query_type)
virtual uint cols () const
virtual enum_engine_type engine_type () const
const st_join_tableget_join_tab () const
Itemget_cond_for_explain () const
- Public Member Functions inherited from subselect_indexsubquery_engine
 subselect_indexsubquery_engine (THD *thd_arg, st_join_table *tab_arg, Item_subselect *subs, Item *where, Item *having_arg, bool chk_null, bool unique_arg)
virtual void fix_length_and_dec (Item_cache **row)
virtual uint8 uncacheable () const
virtual void exclude ()
virtual table_map upper_select_const_tables () const
virtual bool change_result (Item_subselect *si, select_result_interceptor *result)
virtual bool no_tables () const
bool scan_table ()
void copy_ref_key (bool *require_scan, bool *convert_error)
- Public Member Functions inherited from subselect_engine
 subselect_engine (Item_subselect *si, select_result_interceptor *res)
void set_thd_for_result ()
 Sets "thd" for 'result'. Should be called before prepare()
virtual enum Item_result type () const
virtual enum_field_types field_type () const
virtual bool may_be_null () const
virtual bool is_executed () const
const Item_subselectget_item () const

Additional Inherited Members

- Public Types inherited from subselect_engine
enum  enum_engine_type {
  ABSTRACT_ENGINE, SINGLE_SELECT_ENGINE, UNION_ENGINE, UNIQUESUBQUERY_ENGINE,
  INDEXSUBQUERY_ENGINE, HASH_SJ_ENGINE
}
- Static Public Member Functions inherited from subselect_engine
static table_map calc_const_tables (TABLE_LIST *)
- Protected Member Functions inherited from subselect_engine
void set_row (List< Item > &item_list, Item_cache **row)
- Protected Attributes inherited from subselect_indexsubquery_engine
st_join_tabletab
Itemcond

Detailed Description

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.

Definition at line 744 of file item_subselect.h.

Member Function Documentation

void subselect_hash_sj_engine::cleanup ( )
virtual

Cleanup performed after each PS execution.

Called in the end of JOIN::prepare for PS from Item_subselect::cleanup.

Reimplemented from subselect_indexsubquery_engine.

Definition at line 3700 of file item_subselect.cc.

Here is the call graph for this function:

bool subselect_hash_sj_engine::exec ( )
virtual

Execute a subquery IN predicate via materialization.

If needed materialize the subquery into a temporary table, then copmpute the predicate via a lookup into this table.

Return values
TRUEif error
FALSEotherwise

Reimplemented from subselect_indexsubquery_engine.

Definition at line 3727 of file item_subselect.cc.

Here is the call graph for this function:

void subselect_hash_sj_engine::print ( String str,
enum_query_type  query_type 
)
virtual

Print the state of this engine into a string for debugging and views.

Reimplemented from subselect_indexsubquery_engine.

Definition at line 3847 of file item_subselect.cc.

bool subselect_hash_sj_engine::setup ( List< Item > *  tmp_columns)

Create all structures needed for subquery execution using hash semijoin.

  • Create a temporary table to store the result of the IN subquery. The temporary table has one hash index on all its columns. If single-column, the index allows at most one NULL row.
  • Create a new result sink that sends the result stream of the subquery to the temporary table,
  • Create and initialize a new JOIN_TAB, and TABLE_REF objects to perform lookups into the indexed temporary table.
Parameters
tmp_columnscolumns of temporary table

: Currently Item_subselect::init() already chooses and creates at parse time an engine with a corresponding JOIN to execute the subquery.

Return values
TRUEif error
FALSEotherwise

Definition at line 3492 of file item_subselect.cc.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: