Merge pull request #61511 from jewelzqiu/existing-count

Add docs for lwd-aware merge settings
This commit is contained in:
Yakov Olkhovskiy 2024-03-25 16:59:58 -04:00 committed by GitHub
commit 6c4cd355e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 33 additions and 3 deletions

View File

@ -867,3 +867,31 @@ Default value: `Never`
Persists virtual column `_block_number` on merges.
Default value: false.
## exclude_deleted_rows_for_part_size_in_merge {#exclude_deleted_rows_for_part_size_in_merge}
If enabled, estimated actual size of data parts (i.e., excluding those rows that have been deleted through `DELETE FROM`) will be used when selecting parts to merge. Note that this behavior is only triggered for data parts affected by `DELETE FROM` executed after this setting is enabled.
Possible values:
- true, false
Default value: false
**See Also**
- [load_existing_rows_count_for_old_parts](#load_existing_rows_count_for_old_parts) setting
## load_existing_rows_count_for_old_parts {#load_existing_rows_count_for_old_parts}
If enabled along with [exclude_deleted_rows_for_part_size_in_merge](#exclude_deleted_rows_for_part_size_in_merge), deleted rows count for existing data parts will be calculated during table starting up. Note that it may slow down start up table loading.
Possible values:
- true, false
Default value: false
**See Also**
- [exclude_deleted_rows_for_part_size_in_merge](#exclude_deleted_rows_for_part_size_in_merge) setting

View File

@ -1352,8 +1352,9 @@ void IMergeTreeDataPart::loadExistingRowsCount()
if (existing_rows_count.has_value())
return;
if (!rows_count || !storage.getSettings()->load_existing_rows_count_for_old_parts || !supportLightweightDeleteMutate()
|| !hasLightweightDelete())
if (!rows_count || !supportLightweightDeleteMutate() || !hasLightweightDelete()
|| !storage.getSettings()->exclude_deleted_rows_for_part_size_in_merge
|| !storage.getSettings()->load_existing_rows_count_for_old_parts)
existing_rows_count = rows_count;
else
existing_rows_count = readExistingRowsCount();

View File

@ -673,7 +673,8 @@ private:
/// For the older format version calculates rows count from the size of a column with a fixed size.
void loadRowsCount();
/// Load existing rows count from _row_exists column if load_existing_rows_count_for_old_parts is true.
/// Load existing rows count from _row_exists column
/// if load_existing_rows_count_for_old_parts and exclude_deleted_rows_for_part_size_in_merge are both enabled.
void loadExistingRowsCount();
static void appendFilesOfRowsCount(Strings & files);