32#ifndef row0pread_histogram_h
33#define row0pread_histogram_h
47 double sampling_percentage,
Definition: row0pread-histogram.h:39
std::atomic_size_t m_n_sampled
Number of rows sampled.
Definition: row0pread-histogram.h:180
dberr_t process_leaf_rec(const Parallel_reader::Ctx *ctx, row_prebuilt_t *prebuilt)
Process the record in the leaf page.
Definition: row0pread-histogram.cc:361
int m_sampling_seed
Sampling seed to be used for sampling.
Definition: row0pread-histogram.h:177
os_event_t m_end_buffer_event
Event to notify if the next row has been buffered.
Definition: row0pread-histogram.h:154
bool skip()
Check if the processing of the record needs to be skipped.
Definition: row0pread-histogram.cc:191
void set(byte *buf)
Set the buffer.
Definition: row0pread-histogram.h:71
Parallel_reader m_parallel_reader
The parallel reader.
Definition: row0pread-histogram.h:160
enum_sampling_method m_sampling_method
Sampling method to be used for sampling.
Definition: row0pread-histogram.h:171
void wait_for_end_of_buffering()
Wait till the buffering of the row is complete.
Definition: row0pread-histogram.cc:177
os_event_t m_start_buffer_event
Event to notify if the next row needs to be buffered.
Definition: row0pread-histogram.h:151
static std::uniform_real_distribution< double > m_distribution
Uniform distribution used by the random generator.
Definition: row0pread-histogram.h:168
dberr_t process_non_leaf_rec(const Parallel_reader::Ctx *ctx, row_prebuilt_t *prebuilt)
For each record in a non-leaf block at level 1 (if leaf level is 0) check if the child page needs to ...
Definition: row0pread-histogram.cc:285
double m_sampling_percentage
Sampling percentage to be used for sampling.
Definition: row0pread-histogram.h:174
dberr_t m_err
Error code when the row was buffered.
Definition: row0pread-histogram.h:157
bool is_error_set() const
Definition: row0pread-histogram.h:102
dberr_t run()
Start the sampling process.
Definition: row0pread-histogram.cc:249
dberr_t finish_callback(Parallel_reader::Thread_ctx *reader_thread_ctx)
Each parallel reader thread's end function.
Definition: row0pread-histogram.cc:114
void signal_start_of_buffering()
Signal that the next row needs to be buffered.
Definition: row0pread-histogram.cc:183
dberr_t sample_rec(const Parallel_reader::Ctx *ctx, const rec_t *rec, ulint *offsets, const dict_index_t *index, row_prebuilt_t *prebuilt)
Convert the row in InnoDB format to MySQL format and store in the buffer for server to use.
Definition: row0pread-histogram.cc:253
bool init(trx_t *trx, dict_index_t *index, row_prebuilt_t *prebuilt)
Initialize the sampler context.
Definition: row0pread-histogram.cc:140
byte * m_buf
Buffer to store the sampled row which is in the MySQL format.
Definition: row0pread-histogram.h:148
dberr_t start_callback(Parallel_reader::Thread_ctx *reader_thread_ctx)
Each parallel reader thread's init function.
Definition: row0pread-histogram.cc:96
Histogram_sampler(size_t max_threads, int sampling_seed, double sampling_percentage, enum_sampling_method sampling_method)
Constructor.
Definition: row0pread-histogram.cc:44
void set_error_state(dberr_t err)
Set the error state.
Definition: row0pread-histogram.h:99
std::mt19937 m_random_generator
Random generator engine used to provide us random uniformly distributed values required to decide if ...
Definition: row0pread-histogram.h:165
void buffer_end()
End parallel read in case the reader thread is still active and wait for its exit.
Definition: row0pread-histogram.cc:239
~Histogram_sampler()
Destructor.
Definition: row0pread-histogram.cc:89
dberr_t buffer_next()
Buffer next row.
Definition: row0pread-histogram.cc:221
void wait_for_start_of_buffering()
Wait till there is a request to buffer the next row.
Definition: row0pread-histogram.cc:171
void signal_end_of_buffering()
Signal that the buffering of the row is complete.
Definition: row0pread-histogram.cc:187
Parallel reader execution context.
Definition: row0pread.h:679
The core idea is to find the left and right paths down the B+Tree.These paths correspond to the scan ...
Definition: row0pread.h:100
static char buf[MAX_BUF]
Definition: conf_to_src.cc:72
dberr_t
Definition: db0err.h:38
@ DB_SUCCESS
Definition: db0err.h:42
Definition: buf0block_hint.cc:29
static Value err()
Create a Value object that represents an error condition.
Definition: json_binary.cc:926
byte rec_t
Definition: rem0types.h:40
enum_sampling_method
Definition: handler.h:713
Thread related context information.
Definition: row0pread.h:214
Data structure for an index.
Definition: dict0mem.h:1045
InnoDB condition variable.
Definition: os0event.cc:62
A struct for (sometimes lazily) prebuilt structures in an Innobase table handle used within MySQL; th...
Definition: row0mysql.h:514
Definition: trx0trx.h:683
unsigned long int ulint
Definition: univ.i:405