mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
add test
This commit is contained in:
parent
17ab2674f4
commit
1be8b61c5b
@ -396,7 +396,6 @@ void MergeTreeDataPartWriterOnDisk::calculateAndSerializeSkipIndices(const Block
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -603,7 +603,7 @@ MergeTreeDataWriter::TemporaryPart MergeTreeDataWriter::writeTempPartImpl(
|
||||
{
|
||||
ProfileEventTimeIncrement<Microseconds> watch(ProfileEvents::MergeTreeDataWriterProjectionsCalculationMicroseconds);
|
||||
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())
|
||||
|
@ -0,0 +1 @@
|
||||
1 1 1 1 1
|
46
tests/queries/0_stateless/02982_perf_introspection_for_inserts.sh
Executable file
46
tests/queries/0_stateless/02982_perf_introspection_for_inserts.sh
Executable 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';
|
||||
"""
|
Loading…
Reference in New Issue
Block a user