MySQL 8.4.2
Source Code Documentation
|
Implements the row and column memory management for parse and load operations. More...
#include <bulk_data_service.h>
Public Member Functions | |
Row_bunch (size_t n_cols) | |
Create a new row bunch. More... | |
size_t | get_num_rows () const |
size_t | get_num_cols () const |
template<typename F > | |
bool | process_columns (size_t row_index, F &&cbk) |
Process all columns, invoking callback for each. More... | |
template<typename F > | |
bool | process_columns_by_offset (size_t row_offset, F &&cbk) |
size_t | get_row_offset (size_t row_index) const |
Get current row offset to access columns. More... | |
size_t | get_next_row_offset (size_t &offset) const |
Get next row offset from current row offset. More... | |
Column_type & | get_column (size_t row_offset, size_t col_index) |
Get column using row offset and column index. More... | |
const Column_type & | read_column (size_t row_offset, size_t col_index) const |
Get constant column for reading using row offset and column index. More... | |
bool | set_num_rows (size_t n_rows) |
Set the number of rows. More... | |
Static Public Attributes | |
static const size_t | S_MAX_TOTAL_COLS = 600 * 1024 * 1024 |
Limit allocation up to 600M columns. More... | |
Private Attributes | |
std::vector< Column_type > | m_columns |
All the columns. More... | |
size_t | m_num_rows {} |
Number of rows. More... | |
size_t | m_num_columns {} |
Number of columns in each row. More... | |
Implements the row and column memory management for parse and load operations.
We try to pre-allocate the memory contiguously as much as we can to maximize the performance.
Column_type | Column_text when used in the CSV context, Column_sql when used in the InnoDB context. |
Create a new row bunch.
[in] | n_cols | number of columns |
|
inline |
Get column using row offset and column index.
[in] | row_offset | row offset in column vector |
[in] | col_index | index of the column within row |
|
inline |
Get next row offset from current row offset.
[in,out] | offset | row offset |
|
inline |
|
inline |
|
inline |
Get current row offset to access columns.
[in] | row_index | row index |
|
inline |
Process all columns, invoking callback for each.
[in] | row_index | index of the row |
[in] | cbk | callback function |
|
inline |
|
inline |
Get constant column for reading using row offset and column index.
[in] | row_offset | row offset in column vector |
[in] | col_index | index of the column within row |
|
inline |
Set the number of rows.
Adjust number of rows base on maximum column storage limit.
[in,out] | n_rows | number of rows |
|
private |
All the columns.
|
private |
Number of columns in each row.
|
private |
Number of rows.
|
static |
Limit allocation up to 600M columns.
This number is rounded up from an estimate of the number of columns with the max chunk size (1024M). In the worst case we can have 2 bytes per column so a chunk can contain around 512M columns, and because of rows that spill over chunk boundaries we assume we can append a full additional row (which should have at most 4096 columns). Rounded up to 600M.