MySQL 9.1.0
Source Code Documentation
|
Purge obsolete records. More...
#include "row0purge.h"
#include <stddef.h>
#include "current_thd.h"
#include "debug_sync.h"
#include "mysqld.h"
#include "string_with_len.h"
#include "dict0dd.h"
#include "fsp0fsp.h"
#include "ha_innodb.h"
#include "handler.h"
#include "lob0lob.h"
#include "log0chkp.h"
#include "mach0data.h"
#include "que0que.h"
#include "row0log.h"
#include "row0mysql.h"
#include "row0row.h"
#include "row0upd.h"
#include "row0vers.h"
#include "sql_base.h"
#include "srv0mon.h"
#include "srv0start.h"
#include "sync0types.h"
#include "table.h"
#include "trx0purge.h"
#include "trx0rec.h"
#include "trx0roll.h"
#include "trx0rseg.h"
#include "trx0trx.h"
#include "trx0undo.h"
Functions | |
purge_node_t * | row_purge_node_create (que_thr_t *parent, mem_heap_t *heap) |
Create a purge node to a query graph. More... | |
static bool | row_purge_reposition_pcur (ulint mode, purge_node_t *node, mtr_t *mtr) |
Repositions the pcur in the purge node on the clustered index record, if found. More... | |
static bool | row_purge_remove_clust_if_poss_low (purge_node_t *node, ulint mode) |
Removes a delete marked clustered index record if possible. More... | |
static bool | row_purge_remove_clust_if_poss (purge_node_t *node) |
Removes a clustered index record if it has not been modified after the delete marking. More... | |
bool | row_purge_poss_sec (purge_node_t *node, dict_index_t *index, const dtuple_t *entry) |
Determines if it is possible to remove a secondary index entry. More... | |
static bool | row_purge_remove_sec_if_poss_tree (purge_node_t *node, dict_index_t *index, const dtuple_t *entry) |
static bool | row_purge_remove_sec_if_poss_leaf (purge_node_t *node, dict_index_t *index, const dtuple_t *entry) |
static void | row_purge_remove_sec_if_poss (purge_node_t *node, dict_index_t *index, const dtuple_t *entry) |
Removes a secondary index entry if possible. More... | |
static void | row_purge_skip_uncommitted_virtual_index (dict_index_t *&index) |
Skip uncommitted virtual indexes on newly added virtual column. More... | |
static void | row_purge_remove_multi_sec_if_poss (purge_node_t *node, mem_heap_t *heap, bool selected) |
Remove multi-value index entries if possible. More... | |
static bool | row_purge_del_mark (purge_node_t *node) |
Purges a delete marking of a record. More... | |
static void | row_purge_upd_exist_or_extern_func (const que_thr_t *thr, purge_node_t *node, trx_undo_rec_t *undo_rec) |
Purges an update of an existing record. More... | |
void | row_purge_upd_exist_or_extern (const que_thr_t *thr, purge_node_t *node, trx_undo_rec_t *undo_rec) |
static bool | row_purge_parse_undo_rec (purge_node_t *node, trx_undo_rec_t *undo_rec, bool *updated_extern, THD *thd, que_thr_t *thr) |
Parses the row reference and other info in a modify undo log record. More... | |
static bool | row_purge_record_func (purge_node_t *node, trx_undo_rec_t *undo_rec, const que_thr_t *thr, bool updated_extern, THD *thd) |
Purges the parsed record. More... | |
bool | row_purge_record (purge_node_t *node, trx_undo_rec_t *undo_rec, const que_thr_t *thr, bool updated_extern, THD *thd) |
static void | row_purge (purge_node_t *node, trx_undo_rec_t *undo_rec, que_thr_t *thr) |
Fetches an undo log record and does the purge for the recorded operation. More... | |
static void | row_purge_end (que_thr_t *thr) |
Reset the purge query thread. More... | |
que_thr_t * | row_purge_step (que_thr_t *thr) |
Does the purge operation for a single undo log record. More... | |
Purge obsolete records.
Created 3/14/1997 Heikki Tuuri
|
static |
Fetches an undo log record and does the purge for the recorded operation.
If none left, or the current purge completed, returns the control to the parent node, which is always a query thread node.
node | in: row purge node |
undo_rec | in: record to purge |
thr | in: query thread |
|
static |
Purges a delete marking of a record.
true | if the row was not found, or it was successfully removed |
false | the purge needs to be suspended because of running out of file space |
node | in/out: row purge node |
|
static |
Reset the purge query thread.
[in,out] | thr | The query thread to execute |
purge_node_t * row_purge_node_create | ( | que_thr_t * | parent, |
mem_heap_t * | heap | ||
) |
Create a purge node to a query graph.
[in] | parent | parent node, i.e., a thr node |
[in] | heap | memory heap where created |
|
static |
Parses the row reference and other info in a modify undo log record.
[in,out] | node | row undo node |
[in] | undo_rec | undo record to purge |
[out] | updated_extern | whether an externally stored field was updated |
[in,out] | thd | current thread |
[in,out] | thr | execution thread |
bool row_purge_poss_sec | ( | purge_node_t * | node, |
dict_index_t * | index, | ||
const dtuple_t * | entry | ||
) |
Determines if it is possible to remove a secondary index entry.
Removal is possible if the secondary index entry does not refer to any not delete marked version of a clustered index record where DB_TRX_ID is newer than the purge view.
NOTE: This function should only be called by the purge thread, only while holding a latch on the leaf page of the secondary index entry (or keeping the buffer pool watch on the page). It is possible that this function first returns true and then false, if a user transaction inserts a record that the secondary index entry would refer to. However, in that case, the user transaction would also re-insert the secondary index entry after purge has removed it and released the leaf page latch.
node | in/out: row purge node |
index | in: secondary index |
entry | in: secondary index entry |
|
inline |
|
static |
Purges the parsed record.
[in,out] | node | row purge node |
[in] | undo_rec | undo record to purge |
[in,out] | thr | query thread |
[in] | updated_extern | whether external columns were updated |
[in,out] | thd | current thread |
|
static |
Removes a clustered index record if it has not been modified after the delete marking.
true | if the row was not found, or it was successfully removed |
false | the purge needs to be suspended because of running out of file space. |
node | in/out: row purge node |
|
static |
Removes a delete marked clustered index record if possible.
true | if the row was not found, or it was successfully removed |
false | if the row was modified after the delete marking |
node | in/out: row purge node |
mode | in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE |
|
inlinestatic |
Remove multi-value index entries if possible.
[in,out] | node | row purge node |
[in,out] | heap | memory heap |
[in] | selected | true if only selected multi-value data should be purged |
|
inlinestatic |
Removes a secondary index entry if possible.
node | in: row purge node |
index | in: index |
entry | in: index entry |
|
static |
node | in: row purge node |
index | in: index |
entry | in: index entry |
|
static |
node | in: row purge node |
index | in: index |
entry | in: index entry |
|
static |
Repositions the pcur in the purge node on the clustered index record, if found.
If the record is not found, close pcur.
mode | in: latching mode |
node | in: row purge node |
mtr | in: mtr |
|
inlinestatic |
Skip uncommitted virtual indexes on newly added virtual column.
[in,out] | index | dict index object |
Does the purge operation for a single undo log record.
in: query thread
This is a high-level function used in an SQL execution graph.
[in,out] | thr | The query thread to execute |
|
inline |
|
static |
Purges an update of an existing record.
Also purges an update of a delete marked record if that record contained an externally stored field.
[in] | thr | query thread |
[in] | node | row purge node |
[in] | undo_rec | record to purge |