MySQL  8.0.27
Source Code Documentation
records.cc File Reference

Implementations of basic iterators, ie. More...

#include "sql/records.h"
#include <string.h>
#include <algorithm>
#include <atomic>
#include <new>
#include "my_base.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_sys.h"
#include "sql/debug_sync.h"
#include "sql/handler.h"
#include "sql/item.h"
#include "sql/join_optimizer/access_path.h"
#include "sql/join_optimizer/bit_utils.h"
#include "sql/key.h"
#include "sql/opt_explain.h"
#include "sql/range_optimizer/range_optimizer.h"
#include "sql/sql_class.h"
#include "sql/sql_const.h"
#include "sql/sql_executor.h"
#include "sql/sql_optimizer.h"
#include "sql/sql_sort.h"
#include "sql/sql_tmp_table.h"
#include "sql/table.h"
#include "sql/timing_iterator.h"

Functions

AccessPathcreate_table_access_path (THD *thd, TABLE *table, QUICK_SELECT_I *quick, TABLE_LIST *table_ref, POSITION *position, bool count_examined_rows)
 create_table_access_path is used to scan by using a number of different methods. More...
 
unique_ptr_destroy_only< RowIteratorinit_table_iterator (THD *thd, TABLE *table, QUICK_SELECT_I *quick, TABLE_LIST *table_ref, POSITION *position, bool ignore_not_found_rows, bool count_examined_rows)
 Creates an iterator for the given table, then calls Init() on the resulting iterator. More...
 
static bool is_ror (const QUICK_SELECT_I *quick)
 Is this range scan a Rowid-Ordered Retrieval (ROR) index merge? More...
 
static bool has_blob_primary_key (const TABLE *table)
 Does this TABLE have a primary key with a BLOB component? More...
 
static bool should_request_record_buffer (const QUICK_SELECT_I *quick)
 Should a record buffer be requested for this range scan? More...
 

Detailed Description

Implementations of basic iterators, ie.

those that have no children and don't take any refs (they typically read directly from a table in some way). See row_iterator.h.

Function Documentation

◆ create_table_access_path()

AccessPath* create_table_access_path ( THD thd,
TABLE table,
QUICK_SELECT_I quick,
TABLE_LIST table_ref,
POSITION position,
bool  count_examined_rows 
)

create_table_access_path is used to scan by using a number of different methods.

Which method to use is set-up in this call so that you can create an iterator from the returned access path and fetch rows through said iterator afterwards.

Parameters
thdThread handle
tableTable the data [originally] comes from
quickQUICK_SELECT_I to scan the table with, or nullptr
table_refPosition for the table, must be non-nullptr for WITH RECURSIVE
positionPlace to get cost information from, or nullptr
count_examined_rowsSee AccessPath::count_examined_rows.

◆ has_blob_primary_key()

static bool has_blob_primary_key ( const TABLE table)
static

Does this TABLE have a primary key with a BLOB component?

◆ init_table_iterator()

unique_ptr_destroy_only<RowIterator> init_table_iterator ( THD thd,
TABLE table,
QUICK_SELECT_I quick,
TABLE_LIST table_ref,
POSITION position,
bool  ignore_not_found_rows,
bool  count_examined_rows 
)

Creates an iterator for the given table, then calls Init() on the resulting iterator.

Unlike create_table_iterator(), this can create iterators for sort buffer results (which are set in the TABLE object during query execution). Returns nullptr on failure.

◆ is_ror()

static bool is_ror ( const QUICK_SELECT_I quick)
static

Is this range scan a Rowid-Ordered Retrieval (ROR) index merge?

◆ should_request_record_buffer()

static bool should_request_record_buffer ( const QUICK_SELECT_I quick)
static

Should a record buffer be requested for this range scan?