MySQL 8.0.39
Source Code Documentation
IteratorProfilerImpl Class Referencefinal

This class is used in implementing the 'EXPLAIN ANALYZE' command. More...

#include <timing_iterator.h>

Inheritance diagram for IteratorProfilerImpl:
[legend]

Public Types

using steady_clock = std::chrono::steady_clock
 
using duration = steady_clock::time_point::duration
 
using TimeStamp = steady_clock::time_point
 

Public Member Functions

double GetFirstRowMs () const override
 Time (in ms) spent fetching the first row. More...
 
double GetLastRowMs () const override
 Time (in ms) spent fetching the remaining rows. More...
 
uint64_t GetNumInitCalls () const override
 The number of loops (i.e number of iterator->Init() calls. More...
 
uint64_t GetNumRows () const override
 The number of rows fetched. More...
 
void StopInit (TimeStamp start_time)
 Mark the end of an iterator->Init() call. More...
 
void IncrementNumRows (uint64_t materialized_rows)
 Update the number of rows read. More...
 
void StopRead (TimeStamp start_time, bool read_ok)
 Mark the end of an iterator->Read() call. More...
 
- Public Member Functions inherited from IteratorProfiler
virtual ~IteratorProfiler ()=default
 

Static Public Member Functions

static TimeStamp Now ()
 Return current time. More...
 

Static Private Member Functions

static double DurationToMs (duration dur)
 

Private Attributes

uint64_t m_num_init_calls {0}
 The number of loops. More...
 
uint64_t m_num_rows {0}
 The number of rows fetched. More...
 
bool m_first_row
 True if we are about to read the first row. More...
 
duration m_elapsed_first_row {0}
 Elapsed time in all calls to m_iterator.Init() and Read() for the first row. More...
 
duration m_elapsed_other_rows {0}
 Elapsed time in all calls to m_iterator.Read() for all but the first row. More...
 

Detailed Description

This class is used in implementing the 'EXPLAIN ANALYZE' command.

It maintains a set of profiling data.

Member Typedef Documentation

◆ duration

using IteratorProfilerImpl::duration = steady_clock::time_point::duration

◆ steady_clock

using IteratorProfilerImpl::steady_clock = std::chrono::steady_clock

◆ TimeStamp

using IteratorProfilerImpl::TimeStamp = steady_clock::time_point

Member Function Documentation

◆ DurationToMs()

static double IteratorProfilerImpl::DurationToMs ( duration  dur)
inlinestaticprivate

◆ GetFirstRowMs()

double IteratorProfilerImpl::GetFirstRowMs ( ) const
inlineoverridevirtual

Time (in ms) spent fetching the first row.

(Sum for all loops.)

Implements IteratorProfiler.

◆ GetLastRowMs()

double IteratorProfilerImpl::GetLastRowMs ( ) const
inlineoverridevirtual

Time (in ms) spent fetching the remaining rows.

(Sum for all loops.)

Implements IteratorProfiler.

◆ GetNumInitCalls()

uint64_t IteratorProfilerImpl::GetNumInitCalls ( ) const
inlineoverridevirtual

The number of loops (i.e number of iterator->Init() calls.

Implements IteratorProfiler.

◆ GetNumRows()

uint64_t IteratorProfilerImpl::GetNumRows ( ) const
inlineoverridevirtual

The number of rows fetched.

(Sum for all loops.)

Implements IteratorProfiler.

◆ IncrementNumRows()

void IteratorProfilerImpl::IncrementNumRows ( uint64_t  materialized_rows)
inline

Update the number of rows read.

Note that this function is only called for iterator where we read all rows during iterator->Init() (

See also
MaterializeIterator and
TemptableAggregateIterator).

◆ Now()

static TimeStamp IteratorProfilerImpl::Now ( )
inlinestatic

Return current time.

◆ StopInit()

void IteratorProfilerImpl::StopInit ( TimeStamp  start_time)
inline

Mark the end of an iterator->Init() call.

◆ StopRead()

void IteratorProfilerImpl::StopRead ( TimeStamp  start_time,
bool  read_ok 
)
inline

Mark the end of an iterator->Read() call.

Parameters
start_timetime when Read() started.
read_ok'true' if Read() was successful.

Member Data Documentation

◆ m_elapsed_first_row

duration IteratorProfilerImpl::m_elapsed_first_row {0}
private

Elapsed time in all calls to m_iterator.Init() and Read() for the first row.

◆ m_elapsed_other_rows

duration IteratorProfilerImpl::m_elapsed_other_rows {0}
private

Elapsed time in all calls to m_iterator.Read() for all but the first row.

◆ m_first_row

bool IteratorProfilerImpl::m_first_row
private

True if we are about to read the first row.

◆ m_num_init_calls

uint64_t IteratorProfilerImpl::m_num_init_calls {0}
private

The number of loops.

◆ m_num_rows

uint64_t IteratorProfilerImpl::m_num_rows {0}
private

The number of rows fetched.

(Sum for all loops.)


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