add docs & minor fix for lwd-aware merge settings

This commit is contained in:
Zhuo Qiu 2024-03-18 11:02:02 +08:00
parent 3098cd2bad
commit bf85f7f368
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.
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

@ -1349,8 +1349,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

@ -674,7 +674,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);