MySQL 8.0.40
Source Code Documentation
|
Merge the blocks in the file. More...
#include <ddl0impl-merge.h>
Classes | |
struct | Context |
Context to use for merging the files/runs. More... | |
struct | Cursor |
Cursor for merging blocks from the same file. More... | |
struct | Output_file |
For writing out the merged rows. More... | |
Public Types | |
using | Ranges = std::vector< os_offset_t > |
Offsets of record lists to merge. More... | |
Public Member Functions | |
Merge_file_sort (Context *merge_ctx) noexcept | |
Constructor. More... | |
dberr_t | sort (Builder *builder, Merge_offsets &offsets) noexcept |
Merge the the blocks. More... | |
uint64_t | get_n_rows () const noexcept |
Static Public Attributes | |
static constexpr size_t | N_WAY_MERGE = 2 |
The design is generalized as an N way merge, however we stick with 2 for now. More... | |
Private Member Functions | |
dberr_t | merge_rows (Cursor &cursor, Output_file &output_file) noexcept |
Merge the rows. More... | |
dberr_t | merge_ranges (Cursor &cursor, Merge_offsets &offsets, Output_file &output_file, size_t buffer_size) noexcept |
Merge the blocks in the ranges. More... | |
Ranges | next_ranges (Merge_offsets &offsets) noexcept |
Move to the next ranges of pages to merge. More... | |
Private Attributes | |
Dup * | m_dup {} |
To check and report duplicates. More... | |
Context * | m_merge_ctx {} |
Meta data for merging blocks. More... | |
Merge_offsets | m_next_offsets {} |
Page numbers to merge for the next pass. More... | |
uint64_t | m_n_rows {} |
Number of rows in the sorted file. More... | |
Merge the blocks in the file.
using ddl::Merge_file_sort::Ranges = std::vector<os_offset_t> |
Offsets of record lists to merge.
Two adjacent entries make one list or range
|
inlineexplicitnoexcept |
Constructor.
[in,out] | merge_ctx | Data blocks merge meta data. |
|
inlinenoexcept |
|
privatenoexcept |
Merge the blocks in the ranges.
[in,out] | cursor | To iterate over the rows to merge. |
[in,out] | offsets | Starting offsets of record lists to merge. |
[in,out] | output_file | Output file to write the merged rows. |
[in] | buffer_size | IO buffer size for reads. |
|
privatenoexcept |
Merge the rows.
[in,out] | cursor | To iterate over the rows to merge. |
[in,out] | output_file | Output file to write the merged rows. |
|
privatenoexcept |
Move to the next ranges of pages to merge.
[in,out] | offsets | Current offsets to start the merge from. |
|
noexcept |
Merge the the blocks.
[in,out] | builder | Builder instance used for building index. |
[in,out] | offsets | Offsets from where to start the merge. |
|
private |
To check and report duplicates.
|
private |
Meta data for merging blocks.
|
private |
Number of rows in the sorted file.
|
private |
Page numbers to merge for the next pass.
|
staticconstexpr |
The design is generalized as an N way merge, however we stick with 2 for now.