MySQL 9.0.0
Source Code Documentation
Modification_plan Class Reference

Table modification plan for JOIN-less statements (update/delete) More...

#include <opt_explain.h>

Public Member Functions

 Modification_plan (THD *thd_arg, enum_mod_type mt, TABLE *table_arg, enum join_type type_arg, AccessPath *quick_arg, Item *condition_arg, uint key_arg, ha_rows limit_arg, bool need_tmp_table_arg, bool need_sort_arg, bool used_key_is_modified_arg, ha_rows rows)
 Modification_plan's constructor, to represent that we will use an access method on the table. More...
 
 Modification_plan (THD *thd_arg, enum_mod_type mt, TABLE *table_arg, const char *message_arg, bool zero_result_arg, ha_rows rows)
 Modification_plan's constructor, to convey a message in the "extra" column of EXPLAIN. More...
 
 ~Modification_plan ()
 

Public Attributes

THD *const thd
 Owning thread. More...
 
const enum_mod_type mod_type
 Modification type - MT_INSERT/MT_UPDATE/etc. More...
 
TABLEtable
 Table to modify. More...
 
enum join_type type = JT_UNKNOWN
 
AccessPathrange_scan {nullptr}
 
Itemcondition {nullptr}
 
uint key
 Key to use. More...
 
ha_rows limit
 Limit. More...
 
bool need_tmp_table
 Whether tmp table needs to be used. More...
 
bool need_sort
 Whether to use filesort. More...
 
bool used_key_is_modified
 Whether the key used to scan is modified. More...
 
const char * message
 Arbitrary message. More...
 
bool zero_result
 true <=> plan will not be executed More...
 
ha_rows examined_rows
 

Private Member Functions

void register_in_thd ()
 

Detailed Description

Table modification plan for JOIN-less statements (update/delete)

Constructor & Destructor Documentation

◆ Modification_plan() [1/2]

Modification_plan::Modification_plan ( THD thd_arg,
enum_mod_type  mt,
TABLE table_arg,
enum join_type  type_arg,
AccessPath range_scan_arg,
Item condition_arg,
uint  key_arg,
ha_rows  limit_arg,
bool  need_tmp_table_arg,
bool  need_sort_arg,
bool  used_key_is_modified_arg,
ha_rows  rows 
)

Modification_plan's constructor, to represent that we will use an access method on the table.

Create single table modification plan. The plan is registered in the given thd unless the modification is done in a sub-statement (function/trigger).

Parameters
thd_argowning thread
mtmodification type - MT_INSERT/MT_UPDATE/etc
table_argTable to modify
type_argAccess type (JT_*) for this table
range_scan_argRange index scan used, if any
condition_argCondition applied, if any
key_argMAX_KEY or and index number of the key that was chosen to access table data.
limit_argHA_POS_ERROR or LIMIT value.
need_tmp_table_argtrue if it requires temporary table – "Using temporary" string in the "extra" column.
need_sort_argtrue if it requires filesort() – "Using filesort" string in the "extra" column.
used_key_is_modified_argUPDATE updates used key column
rowsHow many rows we plan to modify in the table.

◆ Modification_plan() [2/2]

Modification_plan::Modification_plan ( THD thd_arg,
enum_mod_type  mt,
TABLE table_arg,
const char *  message_arg,
bool  zero_result_arg,
ha_rows  rows 
)

Modification_plan's constructor, to convey a message in the "extra" column of EXPLAIN.

This is for the case where this message is the main information (there is no access path to the table).

Create minimal single table modification plan. The plan is registered in the given thd unless the modification is done in a sub-statement (function/trigger).

Parameters
thd_argOwning thread
mtModification type - MT_INSERT/MT_UPDATE/etc
table_argTable to modify
message_argMessage
zero_result_argIf we shortcut execution
rowsHow many rows we plan to modify in the table.

◆ ~Modification_plan()

Modification_plan::~Modification_plan ( )

Member Function Documentation

◆ register_in_thd()

void Modification_plan::register_in_thd ( )
private

Member Data Documentation

◆ condition

Item* Modification_plan::condition {nullptr}

◆ examined_rows

ha_rows Modification_plan::examined_rows

of rows expected to be examined in the table

◆ key

uint Modification_plan::key

Key to use.

◆ limit

ha_rows Modification_plan::limit

Limit.

◆ message

const char* Modification_plan::message

Arbitrary message.

◆ mod_type

const enum_mod_type Modification_plan::mod_type

Modification type - MT_INSERT/MT_UPDATE/etc.

◆ need_sort

bool Modification_plan::need_sort

Whether to use filesort.

◆ need_tmp_table

bool Modification_plan::need_tmp_table

Whether tmp table needs to be used.

◆ range_scan

AccessPath* Modification_plan::range_scan {nullptr}

◆ table

TABLE* Modification_plan::table

Table to modify.

◆ thd

THD* const Modification_plan::thd

Owning thread.

◆ type

enum join_type Modification_plan::type = JT_UNKNOWN

◆ used_key_is_modified

bool Modification_plan::used_key_is_modified

Whether the key used to scan is modified.

◆ zero_result

bool Modification_plan::zero_result

true <=> plan will not be executed


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