MySQL 8.0.41
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
IndexPurge Class Reference

Class that purges delete marked records from indexes, both secondary and cluster. More...

Public Member Functions

 IndexPurge (trx_t *trx, dict_index_t *index) 1
 Constructor. More...
 
 ~IndexPurge () 1=default
 Destructor. More...
 
dberr_t garbage_collect () 1
 Purge delete marked records. More...
 
ulint get_n_rows () const 1
 The number of records that are not delete marked. More...
 

Protected Member Functions

 IndexPurge ()
 
 IndexPurge (const IndexPurge &)
 
IndexPurgeoperator= (const IndexPurge &)
 

Private Member Functions

void open () 1
 Begin import, position the cursor on the first record. More...
 
void close () 1
 Close the persistent curosr and commit the mini-transaction. More...
 
dberr_t next () 1
 Position the cursor on the next record. More...
 
void purge_pessimistic_delete () 1
 Store the persistent cursor position and reopen the B-tree cursor in BTR_MODIFY_TREE mode, because the tree structure may be changed during a pessimistic delete. More...
 
void purge () 1
 Purge delete-marked records. More...
 

Private Attributes

trx_tm_trx
 User transaction. More...
 
mtr_t m_mtr
 Mini-transaction. More...
 
btr_pcur_t m_pcur
 Persistent cursor. More...
 
dict_index_tm_index
 Index to be processed. More...
 
ulint m_n_rows
 Records in index. More...
 

Detailed Description

Class that purges delete marked records from indexes, both secondary and cluster.

It does a pessimistic delete. This should only be done if we couldn't purge the delete marked records during Phase I.

Constructor & Destructor Documentation

◆ IndexPurge() [1/3]

IndexPurge::IndexPurge ( trx_t trx,
dict_index_t index 
)
inline

Constructor.

Parameters
trxthe user transaction covering the import tablespace
indexto be imported.

◆ ~IndexPurge()

IndexPurge::~IndexPurge ( )
default

Destructor.

◆ IndexPurge() [2/3]

IndexPurge::IndexPurge ( )
protected

◆ IndexPurge() [3/3]

IndexPurge::IndexPurge ( const IndexPurge )
protected

Member Function Documentation

◆ close()

void IndexPurge::close ( void  )
private

Close the persistent curosr and commit the mini-transaction.

◆ garbage_collect()

dberr_t IndexPurge::garbage_collect ( )

Purge delete marked records.

Returns
DB_SUCCESS or error code.

◆ get_n_rows()

ulint IndexPurge::get_n_rows ( ) const
inline

The number of records that are not delete marked.

Returns
total records in the index after purge

◆ next()

dberr_t IndexPurge::next ( void  )
private

Position the cursor on the next record.

Returns
DB_SUCCESS or error code

◆ open()

void IndexPurge::open ( )
private

Begin import, position the cursor on the first record.

◆ operator=()

IndexPurge & IndexPurge::operator= ( const IndexPurge )
protected

◆ purge()

void IndexPurge::purge ( )
private

Purge delete-marked records.

◆ purge_pessimistic_delete()

void IndexPurge::purge_pessimistic_delete ( )
private

Store the persistent cursor position and reopen the B-tree cursor in BTR_MODIFY_TREE mode, because the tree structure may be changed during a pessimistic delete.

Member Data Documentation

◆ m_index

dict_index_t* IndexPurge::m_index
private

Index to be processed.

◆ m_mtr

mtr_t IndexPurge::m_mtr
private

Mini-transaction.

◆ m_n_rows

ulint IndexPurge::m_n_rows
private

Records in index.

◆ m_pcur

btr_pcur_t IndexPurge::m_pcur
private

Persistent cursor.

◆ m_trx

trx_t* IndexPurge::m_trx
private

User transaction.


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