MySQL 8.4.2
Source Code Documentation
|
Descriptor for a merge chunk to be sort-merged. More...
#include <sql_sort.h>
Public Member Functions | |
my_off_t | file_position () const |
void | set_file_position (my_off_t val) |
void | advance_file_position (my_off_t val) |
uchar * | buffer_start () |
const uchar * | buffer_end () const |
const uchar * | valid_buffer_end () const |
void | set_buffer (uchar *start, uchar *end) |
void | set_buffer_start (uchar *start) |
void | set_buffer_end (uchar *end) |
void | set_valid_buffer_end (uchar *end) |
void | init_current_key () |
uchar * | current_key () const |
void | advance_current_key (uint val) |
void | decrement_rowcount (ha_rows val) |
void | set_rowcount (ha_rows val) |
ha_rows | rowcount () const |
ha_rows | mem_count () const |
void | set_mem_count (ha_rows val) |
ha_rows | decrement_mem_count () |
ha_rows | max_keys () const |
void | set_max_keys (ha_rows val) |
size_t | buffer_size () const |
bool | merge_freed_buff (Merge_chunk *mc) const |
Tries to merge *this with *mc, returns true if successful. More... | |
Private Attributes | |
uchar * | m_current_key = nullptr |
The current key for this chunk. More... | |
my_off_t | m_file_position = 0 |
Current position in the file to be sorted. More... | |
uchar * | m_buffer_start = nullptr |
Start of main-memory buffer for this chunk. More... | |
uchar * | m_buffer_end = nullptr |
End of main-memory buffer for this chunk. More... | |
uchar * | m_valid_buffer_end |
End of actual, valid data for this chunk. More... | |
ha_rows | m_rowcount = 0 |
Number of unread rows in this chunk. More... | |
ha_rows | m_mem_count = 0 |
Number of rows in the main-memory buffer. More... | |
ha_rows | m_max_keys = 0 |
If we have fixed-size rows: max number of rows in buffer. More... | |
Descriptor for a merge chunk to be sort-merged.
A merge chunk is a sequence of pre-sorted records, written to a temporary file. A Merge_chunk instance describes where this chunk is stored in the file, and where it is located when it is in memory.
It is a POD because we read/write them from/to files (but note, only m_file_position and m_rowcount are actually used in that situation).
We have accessors (getters/setters) for all struct members.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Tries to merge *this with *mc, returns true if successful.
The assumption is that *this is no longer in use, and the space it has been allocated can be handed over to a buffer which is adjacent to it.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
Current position in the file to be sorted.
|
private |
If we have fixed-size rows: max number of rows in buffer.
|
private |
Number of rows in the main-memory buffer.
|
private |
Number of unread rows in this chunk.
|
private |
End of actual, valid data for this chunk.