This commit is contained in:
Nikita Taranov 2024-01-30 20:50:03 +01:00
parent 17ab2674f4
commit 1be8b61c5b
4 changed files with 48 additions and 2 deletions

View File

@ -396,7 +396,6 @@ void MergeTreeDataPartWriterOnDisk::calculateAndSerializeSkipIndices(const Block
index_build_us += watch.elapsed<Microseconds>(); index_build_us += watch.elapsed<Microseconds>();
} }
// clang-format off
LOG_DEBUG(log, "Spent {} ms calculating index {} for the part {}", index_build_us / 1000, skip_indices[i]->index.name, data_part->name); LOG_DEBUG(log, "Spent {} ms calculating index {} for the part {}", index_build_us / 1000, skip_indices[i]->index.name, data_part->name);
} }
} }

View File

@ -603,7 +603,7 @@ MergeTreeDataWriter::TemporaryPart MergeTreeDataWriter::writeTempPartImpl(
{ {
ProfileEventTimeIncrement<Microseconds> watch(ProfileEvents::MergeTreeDataWriterProjectionsCalculationMicroseconds); ProfileEventTimeIncrement<Microseconds> watch(ProfileEvents::MergeTreeDataWriterProjectionsCalculationMicroseconds);
projection_block = projection.calculate(block, context); projection_block = projection.calculate(block, context);
LOG_DEBUG(log, "Spent {} ms calculating projection {} for the part {}", watch.elapsed(), projection.name, new_data_part->name); LOG_DEBUG(log, "Spent {} ms calculating projection {} for the part {}", watch.elapsed() / 1000, projection.name, new_data_part->name);
} }
if (projection_block.rows()) if (projection_block.rows())

View File

@ -0,0 +1 @@
1 1 1 1 1

View File

@ -0,0 +1,46 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
$CLICKHOUSE_CLIENT -q """
CREATE TABLE t02982
(
n UInt64,
s Nullable(String),
INDEX idx1 n TYPE minmax GRANULARITY 2,
INDEX idx2 n * length(s) TYPE set(1000) GRANULARITY 2,
PROJECTION pr_sort
(
SELECT
n,
sum(length(s))
GROUP BY n
)
)
ENGINE = MergeTree
ORDER BY n;
"""
query_id=$RANDOM
$CLICKHOUSE_CLIENT --query_id $query_id -q """
INSERT INTO t02982 SELECT
number,
'a'
FROM numbers_mt(1000000);
"""
$CLICKHOUSE_CLIENT -q "SYSTEM FLUSH LOGS"
$CLICKHOUSE_CLIENT -q """
SELECT
ProfileEvents['MergeTreeDataProjectionWriterMergingBlocksMicroseconds'] > 0,
ProfileEvents['MergeTreeDataProjectionWriterPrimaryKeyCalculationMicroseconds'] > 0,
ProfileEvents['MergeTreeDataWriterPrimaryKeyCalculationMicroseconds'] > 0,
ProfileEvents['MergeTreeDataWriterProjectionsCalculationMicroseconds'] > 0,
ProfileEvents['MergeTreeDataWriterSecondaryIndicesCalculationMicroseconds'] > 0
FROM system.query_log
WHERE current_database = currentDatabase() AND query_id='$query_id' AND type = 'QueryFinish';
"""