Drizzled Public API Documentation

drizzled::subselect_hash_sj_engine Class Reference

#include <subselect.h>

Inheritance diagram for drizzled::subselect_hash_sj_engine:
drizzled::subselect_uniquesubquery_engine drizzled::subselect_engine drizzled::memory::SqlAlloc

List of all members.

Public Types

enum  enum_engine_type {
  ABSTRACT_ENGINE, SINGLE_SELECT_ENGINE, UNION_ENGINE, UNIQUESUBQUERY_ENGINE,
  INDEXSUBQUERY_ENGINE, HASH_SJ_ENGINE
}

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)
bool init_runtime ()
void cleanup ()
int prepare ()
int exec ()
virtual void print (String *str)
uint32_t cols ()
virtual enum_engine_type engine_type ()
void fix_length_and_dec (Item_cache **row)
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 ()
void set_session (Session *session_arg)
Sessionget_session ()
enum Item_result type ()
enum_field_types field_type ()
virtual bool may_be_null ()
virtual bool is_executed () const

Static Public Member Functions

static table_map calc_const_tables (TableList *)
static void * operator new (size_t size)
static void * operator new (size_t size, Root *mem_root)
static void * operator new[] (size_t size)
static void * operator new[] (size_t size, Root *mem_root)
static void operator delete (void *, size_t)
static void operator delete (void *, Root *)
static void operator delete[] (void *, Root *)
static void operator delete[] (void *, size_t)

Protected Member Functions

void set_row (List< Item > &item_list, Item_cache **row)

Protected Attributes

bool is_materialized
subselect_single_select_enginematerialize_engine
Joinmaterialize_join
Tmp_Table_Paramtmp_param
JoinTabletab
Itemcond
bool empty_result_set
bool null_keypart
select_result_interceptorresult
Sessionsession
Item_subselectitem
enum Item_result res_type
enum_field_types res_field_type
bool maybe_null

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 672 of file subselect.h.


Member Function Documentation

bool drizzled::subselect_uniquesubquery_engine::change_result ( Item_subselect si,
select_result_interceptor result 
) [virtual, inherited]

change select_result emulation, never should be called.

Parameters:
sinew subselect Item
resnew select_result object
Return values:
falseOK
trueerror

Implements drizzled::subselect_engine.

Definition at line 2913 of file subselect.cc.

void drizzled::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 drizzled::subselect_uniquesubquery_engine.

Definition at line 3160 of file subselect.cc.

int drizzled::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 drizzled::subselect_uniquesubquery_engine.

Definition at line 3180 of file subselect.cc.

References drizzled::Join::exec(), drizzled::Session::is_fatal_error, and drizzled::Join::optimize().

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.

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

: 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 3011 of file subselect.cc.

References drizzled::Table::cursor, and drizzled::Table::key_info.

bool 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 3129 of file subselect.cc.

bool drizzled::subselect_uniquesubquery_engine::no_tables ( ) [virtual, inherited]

Report about presence of tables in subquery.

Return values:
truethere are not tables used in subquery
falsethere are some tables in subquery

Implements drizzled::subselect_engine.

Definition at line 2979 of file subselect.cc.

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 3249 of file subselect.cc.


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