MySQL 9.0.0
Source Code Documentation
Parallel_reader::Ctx Class Reference

Parallel reader execution context. More...

#include <row0pread.h>

Public Member Functions

 Ctx (size_t id, Scan_ctx *scan_ctx, const Scan_ctx::Range &range)
 Constructor. More...
 
 ~Ctx ()=default
 Destructor. More...
 
size_t id () const
 
size_t scan_id () const
 The scan ID of the scan context this belongs to. More...
 
const trx_ttrx () const
 
const dict_index_tindex () const
 
size_t thread_id () const
 
Thread_ctxthread_ctx () const
 
size_t partition_id () const
 
bool is_rec_visible (const rec_t *&rec, ulint *&offsets, mem_heap_t *&heap, mtr_t *mtr)
 Build an old version of the row if required. More...
 

Public Attributes

Thread_ctxm_thread_ctx {}
 Context information related to executing thread ID. More...
 
const buf_block_tm_block {}
 Current block. More...
 
const rec_tm_rec {}
 Current row. More...
 
size_t m_n_pages {}
 Number of pages traversed by the context. More...
 
bool m_first_rec {true}
 True if m_rec is the first record in the page. More...
 
ulintm_offsets {}
 
bool m_start {}
 Start of a new range to scan. More...
 

Private Member Functions

dberr_t traverse ()
 Traverse the pages by key order. More...
 
dberr_t traverse_recs (PCursor *pcursor, mtr_t *mtr)
 Traverse the records in a node. More...
 
bool move_to_next_node (PCursor *pcursor)
 Move to the next node in the specified level. More...
 
dberr_t split ()
 Split the context into sub-ranges and add them to the execution queue. More...
 
bool is_error_set () const
 

Private Attributes

size_t m_id {std::numeric_limits<size_t>::max()}
 Context ID. More...
 
bool m_split {}
 If true then split the context at the block level. More...
 
Scan_ctx::Range m_range {}
 Range to read in this context. More...
 
Scan_ctxm_scan_ctx {}
 Scanner context. More...
 

Friends

class Parallel_reader
 

Detailed Description

Parallel reader execution context.

Constructor & Destructor Documentation

◆ Ctx()

Parallel_reader::Ctx::Ctx ( size_t  id,
Scan_ctx scan_ctx,
const Scan_ctx::Range range 
)
inline

Constructor.

Parameters
[in]idThread ID.
[in]scan_ctxScan context.
[in]rangeRange that the thread has to read.

◆ ~Ctx()

Parallel_reader::Ctx::~Ctx ( )
default

Destructor.

Member Function Documentation

◆ id()

size_t Parallel_reader::Ctx::id ( ) const
inline
Returns
the context ID.

◆ index()

const dict_index_t * Parallel_reader::Ctx::index ( ) const
inline
Returns
the index being scanned.

◆ is_error_set()

bool Parallel_reader::Ctx::is_error_set ( ) const
inlineprivate
Returns
true if in error state.

◆ is_rec_visible()

bool Parallel_reader::Ctx::is_rec_visible ( const rec_t *&  rec,
ulint *&  offsets,
mem_heap_t *&  heap,
mtr_t mtr 
)
inline

Build an old version of the row if required.

Parameters
[in,out]recCurrent row read from the index. This can be modified by this method if an older version needs to be built.
[in,out]offsetsSame as above but pertains to the rec offsets
[in,out]heapHeap to use if a previous version needs to be built from the undo log.
[in,out]mtrMini-transaction covering the read.
Returns
true if row is visible to the transaction.

◆ move_to_next_node()

bool Parallel_reader::Ctx::move_to_next_node ( PCursor pcursor)
private

Move to the next node in the specified level.

Parameters
[in]pcursorpersistent b-tree cursor
Returns
success

◆ partition_id()

size_t Parallel_reader::Ctx::partition_id ( ) const
inline
Returns
the partition id of the index.
Note
this is std::numeric_limits<size_t>::max() if the index does not belong to a partition.

◆ scan_id()

size_t Parallel_reader::Ctx::scan_id ( ) const
inline

The scan ID of the scan context this belongs to.

◆ split()

dberr_t Parallel_reader::Ctx::split ( )
private

Split the context into sub-ranges and add them to the execution queue.

Returns
DB_SUCCESS or error code.

◆ thread_ctx()

Thread_ctx * Parallel_reader::Ctx::thread_ctx ( ) const
inline
Returns
the thread context of the reader thread.

◆ thread_id()

size_t Parallel_reader::Ctx::thread_id ( ) const
inline
Returns
ID of the thread processing this context

◆ traverse()

dberr_t Parallel_reader::Ctx::traverse ( )
private

Traverse the pages by key order.

Returns
DB_SUCCESS or error code.

◆ traverse_recs()

dberr_t Parallel_reader::Ctx::traverse_recs ( PCursor pcursor,
mtr_t mtr 
)
private

Traverse the records in a node.

Parameters
[in]pcursorpersistent b-tree cursor
[in]mtrmtr
Returns
error

◆ trx()

const trx_t * Parallel_reader::Ctx::trx ( ) const
inline
Returns
the covering transaction.

Friends And Related Function Documentation

◆ Parallel_reader

friend class Parallel_reader
friend

Member Data Documentation

◆ m_block

const buf_block_t* Parallel_reader::Ctx::m_block {}

Current block.

◆ m_first_rec

bool Parallel_reader::Ctx::m_first_rec {true}

True if m_rec is the first record in the page.

◆ m_id

size_t Parallel_reader::Ctx::m_id {std::numeric_limits<size_t>::max()}
private

Context ID.

◆ m_n_pages

size_t Parallel_reader::Ctx::m_n_pages {}

Number of pages traversed by the context.

◆ m_offsets

ulint* Parallel_reader::Ctx::m_offsets {}

◆ m_range

Scan_ctx::Range Parallel_reader::Ctx::m_range {}
private

Range to read in this context.

◆ m_rec

const rec_t* Parallel_reader::Ctx::m_rec {}

Current row.

◆ m_scan_ctx

Scan_ctx* Parallel_reader::Ctx::m_scan_ctx {}
private

Scanner context.

◆ m_split

bool Parallel_reader::Ctx::m_split {}
private

If true then split the context at the block level.

◆ m_start

bool Parallel_reader::Ctx::m_start {}

Start of a new range to scan.

◆ m_thread_ctx

Thread_ctx* Parallel_reader::Ctx::m_thread_ctx {}

Context information related to executing thread ID.


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