MySQL 8.4.2
Source Code Documentation
row0purge.h File Reference

Purge obsolete records. More...

#include "univ.i"
#include "btr0pcur.h"
#include "btr0types.h"
#include "data0data.h"
#include "dict0types.h"
#include "que0types.h"
#include "row0types.h"
#include "trx0types.h"
#include "ut0vec.h"

Go to the source code of this file.

Classes

struct  Compare_page_free_tuple
 
struct  purge_node_t
 
struct  purge_node_t::rec_t
 Info required to purge a record. More...
 

Typedefs

using Page_free_tuple = std::tuple< index_id_t, page_id_t, table_id_t >
 

Functions

purge_node_trow_purge_node_create (que_thr_t *parent, mem_heap_t *heap)
 Create a purge node to a query graph. 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...
 
que_thr_trow_purge_step (que_thr_t *thr)
 in: query thread More...
 

Detailed Description

Purge obsolete records.

Created 3/14/1997 Heikki Tuuri

Typedef Documentation

◆ Page_free_tuple

Function Documentation

◆ row_purge_node_create()

purge_node_t * row_purge_node_create ( que_thr_t parent,
mem_heap_t heap 
)

Create a purge node to a query graph.

Parameters
[in]parentparent node, i.e., a thr node
[in]heapmemory heap where created
Returns
own: purge node

◆ row_purge_poss_sec()

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.

Returns
true if the secondary index record can be purged in: 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.

Returns
true if the secondary index record can be purged
Parameters
nodein/out: row purge node
indexin: secondary index
entryin: secondary index entry

◆ row_purge_step()

que_thr_t * row_purge_step ( que_thr_t thr)

in: query thread

in: query thread

This is a high-level function used in an SQL execution graph.

Parameters
[in,out]thrThe query thread to execute
Returns
query thread to run next or nullptr