My Project
Public Member Functions
subselect_hash_sj_engine Class Reference

#include <item_subselect.h>

Inheritance diagram for subselect_hash_sj_engine:
subselect_indexsubquery_engine subselect_engine Sql_alloc

List of all members.

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

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.

Member Function Documentation

Cleanup performed after each PS execution.

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

Reimplemented from subselect_indexsubquery_engine.

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

Reimplemented from subselect_indexsubquery_engine.

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.

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.
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

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines