drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
drizzled::subselect_hash_sj_engine Class Reference

#include <subselect.h>

Inheritance diagram for drizzled::subselect_hash_sj_engine:
[legend]
Collaboration diagram for drizzled::subselect_hash_sj_engine:
[legend]

Public Member Functions

 subselect_hash_sj_engine (Session *session_in, Item_subselect *in_predicate, subselect_single_select_engine *old_engine)
bool init_permanent (List< Item > *tmp_columns)
void init_runtime ()
void cleanup ()
int prepare ()
int exec ()
virtual void print (String *str)
uint32_t cols ()
virtual enum_engine_type engine_type ()
Public Member Functions inherited from drizzled::subselect_uniquesubquery_engine
 subselect_uniquesubquery_engine (Session *session_arg, JoinTable *tab_arg, Item_subselect *subs, Item *where)
void cleanup ()
int prepare ()
void fix_length_and_dec (Item_cache **row)
int exec ()
uint32_t cols ()
bool uncacheable ()
bool uncacheable (uint32_t)
void exclude ()
table_map upper_select_const_tables ()
bool change_result (Item_subselect *si, select_result_interceptor *result)
bool no_tables ()
int scan_table ()
bool copy_ref_key ()
bool no_rows ()
Public Member Functions inherited from drizzled::subselect_engine
 subselect_engine (Item_subselect *si, select_result_interceptor *res)
void set_session (Session *session_arg)
Session * get_session ()
enum Item_result type ()
enum_field_types field_type ()
virtual bool may_be_null ()
virtual bool is_executed () const

Protected Attributes

bool is_materialized
subselect_single_select_engine * materialize_engine
Join * materialize_join
Tmp_Table_Param * tmp_param
Protected Attributes inherited from drizzled::subselect_uniquesubquery_engine
JoinTable * tab
Item * cond
bool empty_result_set
bool null_keypart
Protected Attributes inherited from drizzled::subselect_engine
select_result_interceptor * result
Session * session
Item_subselect * item
enum Item_result res_type
enum_field_types res_field_type
bool maybe_null

Additional Inherited Members

Public Types inherited from drizzled::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 drizzled::subselect_engine
static table_map calc_const_tables (TableList *)
Static Public Member Functions inherited from drizzled::memory::SqlAlloc
static void * operator new (size_t size)
static void * operator new[] (size_t size)
static void * operator new (size_t size, Root &root)
static void * operator new[] (size_t size, Root &root)
static void * operator new (size_t size, Root *root)
static void * operator new[] (size_t size, Root *root)
static void operator delete (void *)
static void operator delete[] (void *)
static void operator delete (void *, Root &)
static void operator delete[] (void *, Root &)
static void operator delete (void *, Root *)
static void operator delete[] (void *, Root *)
Protected Member Functions inherited from drizzled::subselect_engine
void set_row (List< Item > &item_list, Item_cache **row)

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

Definition at line 649 of file subselect.h.

Constructor & Destructor Documentation

◆ subselect_hash_sj_engine()

drizzled::subselect_hash_sj_engine::subselect_hash_sj_engine ( Session * session_in,
Item_subselect * in_predicate,
subselect_single_select_engine * old_engine )
inline

Definition at line 670 of file subselect.h.

◆ ~subselect_hash_sj_engine()

drizzled::subselect_hash_sj_engine::~subselect_hash_sj_engine ( )

Definition at line 3079 of file subselect.cc.

Member Function Documentation

◆ cleanup()

void drizzled::subselect_hash_sj_engine::cleanup ( )
virtual

Cleanup performed after each PS execution.

@detail Called in the end of Join::prepare for PS from Item_subselect::cleanup.

Implements drizzled::subselect_engine.

Definition at line 3096 of file subselect.cc.

◆ cols()

uint32_t drizzled::subselect_hash_sj_engine::cols ( )
inlinevirtual

Implements drizzled::subselect_engine.

Definition at line 684 of file subselect.h.

◆ engine_type()

virtual enum_engine_type drizzled::subselect_hash_sj_engine::engine_type ( )
inlinevirtual

Reimplemented from drizzled::subselect_uniquesubquery_engine.

Definition at line 688 of file subselect.h.

◆ exec()

int drizzled::subselect_hash_sj_engine::exec ( )
virtual

Execute a subquery IN predicate via materialization.

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

Return values
trueif error
falseotherwise

Implements drizzled::subselect_engine.

Definition at line 3116 of file subselect.cc.

◆ init_permanent()

bool drizzled::subselect_hash_sj_engine::init_permanent ( List< Item > * tmp_columns)

Create all structures needed for IN execution that can live between PS reexecution.

@detail

  • Create a temporary table to store the result of the IN subquery. The temporary table has one hash index on all its columns.
  • Create a new result sink that sends the result stream of the subquery to the temporary table,
  • Create and initialize a new JoinTable, and TABLE_REF objects to perform lookups into the indexed temporary table.

@notice: 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 2958 of file subselect.cc.

◆ init_runtime()

void drizzled::subselect_hash_sj_engine::init_runtime ( )

Initialize members of the engine that need to be re-initilized at each execution.

Return values
trueif a memory allocation error occurred
falseif success

Definition at line 3066 of file subselect.cc.

◆ prepare()

int drizzled::subselect_hash_sj_engine::prepare ( )
inlinevirtual

Implements drizzled::subselect_engine.

Definition at line 681 of file subselect.h.

◆ print()

void drizzled::subselect_hash_sj_engine::print ( String * str)
virtual

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

Reimplemented from drizzled::subselect_uniquesubquery_engine.

Definition at line 3184 of file subselect.cc.

Member Data Documentation

◆ is_materialized

bool drizzled::subselect_hash_sj_engine::is_materialized
protected

Definition at line 653 of file subselect.h.

◆ materialize_engine

subselect_single_select_engine* drizzled::subselect_hash_sj_engine::materialize_engine
protected

Definition at line 660 of file subselect.h.

◆ materialize_join

Join* drizzled::subselect_hash_sj_engine::materialize_join
protected

Definition at line 665 of file subselect.h.

◆ tmp_param

Tmp_Table_Param* drizzled::subselect_hash_sj_engine::tmp_param
protected

Definition at line 667 of file subselect.h.


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