Added treshold setting for Vertical merge algorithm. [#METR-23305]

This commit is contained in:
Vitaliy Lyudvichenko 2016-12-07 00:02:22 +03:00
parent 4df22acea9
commit 8bf6e28887
2 changed files with 5 additions and 2 deletions

View File

@ -93,6 +93,9 @@ struct MergeTreeSettings
/// Enable usage of Vertical merge algorithm.
size_t enable_vertical_merge_algorithm = 0;
/// Minimal (approximate) sum of rows in merging parts to activate Vertical merge algorithm
size_t vertical_merge_algorithm_min_rows_to_activate = 8 * DEFAULT_MERGE_BLOCK_SIZE;
void loadFromConfig(const String & config_elem, Poco::Util::AbstractConfiguration & config)
{

View File

@ -399,12 +399,12 @@ public:
void operator() (const Progress & value)
{
ProfileEvents::increment(ProfileEvents::MergedUncompressedBytes, value.bytes);
ProfileEvents::increment(ProfileEvents::MergedRows, value.rows);
merge_entry->bytes_read_uncompressed += value.bytes;
merge_entry->rows_with_key_columns_read += value.rows;
if (merge_alg == MergeAlgorithm::Horizontal)
{
ProfileEvents::increment(ProfileEvents::MergedRows, value.rows);
merge_entry->rows_read += value.rows;
merge_entry->progress = average_elem_progress * merge_entry->rows_read;
}
@ -707,7 +707,7 @@ MergeTreeDataMerger::MergeAlgorithm MergeTreeDataMerger::chooseMergeAlgorithm(
bool enough_ordinary_cols = data.getColumnNamesList().size() > data.getSortDescription().size();
bool enough_total_rows = sum_rows_upper_bound >= DEFAULT_MERGE_BLOCK_SIZE;
bool enough_total_rows = sum_rows_upper_bound >= data.context.getMergeTreeSettings().vertical_merge_algorithm_min_rows_to_activate;
bool no_parts_overflow = parts.size() <= RowSourcePart::MAX_PARTS;