Skip to content

Commit b36de8d

Browse files
authored
Merge pull request #65 from prashantbytesyntax/clickhouse-schema-fix
fix clickhouse schema
2 parents b7044e6 + 0cbc30b commit b36de8d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/gprofiler_indexer/sql/create_ch_schema_cluster_mode.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ CREATE TABLE IF NOT EXISTS flamedb.samples_1hour_local_store ON CLUSTER '{cluste
114114
ContainerEnvName LowCardinality(String),
115115
HostName LowCardinality(String),
116116
ContainerName LowCardinality(String),
117+
HostNameHash UInt32,
118+
ContainerNameHash UInt32,
117119
CallStackHash UInt64,
118120
CallStackName String CODEC (ZSTD),
119121
CallStackParent UInt64,
@@ -122,7 +124,7 @@ CREATE TABLE IF NOT EXISTS flamedb.samples_1hour_local_store ON CLUSTER '{cluste
122124
ErrNumSamples UInt32
123125
) ENGINE = ReplicatedSummingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', (NumSamples))
124126
PARTITION BY toYYYYMMDD(Timestamp)
125-
ORDER BY (ServiceId, ContainerEnvName, InstanceType, Timestamp, CallStackHash, CallStackParent);
127+
ORDER BY (ServiceId, ContainerEnvName, InstanceType, HostNameHash, ContainerNameHash, Timestamp, CallStackHash, CallStackParent);
126128

127129
CREATE MATERIALIZED VIEW IF NOT EXISTS flamedb.samples_1hour_local ON CLUSTER '{cluster}' TO
128130
flamedb.samples_1hour_local_store AS
@@ -159,6 +161,8 @@ CREATE TABLE IF NOT EXISTS flamedb.samples_1day_local_store ON CLUSTER '{cluster
159161
ContainerEnvName LowCardinality(String),
160162
HostName LowCardinality(String),
161163
ContainerName LowCardinality(String),
164+
HostNameHash UInt32,
165+
ContainerNameHash UInt32,
162166
CallStackHash UInt64,
163167
CallStackName String CODEC (ZSTD),
164168
CallStackParent UInt64,
@@ -167,7 +171,7 @@ CREATE TABLE IF NOT EXISTS flamedb.samples_1day_local_store ON CLUSTER '{cluster
167171
ErrNumSamples UInt32
168172
) ENGINE = ReplicatedSummingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', (NumSamples))
169173
PARTITION BY toYYYYMMDD(Timestamp)
170-
ORDER BY (ServiceId, ContainerEnvName, InstanceType, Timestamp, CallStackHash, CallStackParent);
174+
ORDER BY (ServiceId, ContainerEnvName, InstanceType, HostNameHash, ContainerNameHash, Timestamp, CallStackHash, CallStackParent);
171175

172176

173177
CREATE MATERIALIZED VIEW IF NOT EXISTS flamedb.samples_1day_local ON CLUSTER '{cluster}' TO

0 commit comments

Comments
 (0)