Skip to content

Commit

Permalink
add partitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Savid committed May 1, 2024
1 parent c2148f4 commit 7acb6e8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deploy/migrations/clickhouse/032_libp2p_trace.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ CREATE TABLE libp2p_rpc_meta_message_local ON CLUSTER '{cluster}'
meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)),
meta_network_name LowCardinality(String)
) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time)
PARTITION BY toYYYYMM(event_date_time)
ORDER BY (event_date_time, unique_key, control_index, meta_network_name, meta_client_name);

ALTER TABLE libp2p_rpc_meta_message_local ON CLUSTER '{cluster}'
Expand Down Expand Up @@ -224,6 +225,7 @@ CREATE TABLE libp2p_rpc_meta_subscription_local ON CLUSTER '{cluster}'
meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)),
meta_network_name LowCardinality(String)
) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time)
PARTITION BY toYYYYMM(event_date_time)
ORDER BY (event_date_time, unique_key, control_index, meta_network_name, meta_client_name);

ALTER TABLE libp2p_rpc_meta_subscription_local ON CLUSTER '{cluster}'
Expand Down Expand Up @@ -290,6 +292,7 @@ CREATE TABLE libp2p_rpc_meta_control_ihave_local ON CLUSTER '{cluster}'
meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)),
meta_network_name LowCardinality(String)
) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time)
PARTITION BY toYYYYMM(event_date_time)
ORDER BY (event_date_time, unique_key, control_index, message_index, meta_network_name, meta_client_name);

ALTER TABLE libp2p_rpc_meta_control_ihave_local ON CLUSTER '{cluster}'
Expand Down Expand Up @@ -353,6 +356,7 @@ CREATE TABLE libp2p_rpc_meta_control_iwant_local ON CLUSTER '{cluster}'
meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)),
meta_network_name LowCardinality(String)
) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time)
PARTITION BY toYYYYMM(event_date_time)
ORDER BY (event_date_time, unique_key, control_index, message_index, meta_network_name, meta_client_name);

ALTER TABLE libp2p_rpc_meta_control_iwant_local ON CLUSTER '{cluster}'
Expand Down Expand Up @@ -414,6 +418,7 @@ CREATE TABLE libp2p_rpc_meta_control_graft_local ON CLUSTER '{cluster}'
meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)),
meta_network_name LowCardinality(String)
) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time)
PARTITION BY toYYYYMM(event_date_time)
ORDER BY (event_date_time, unique_key, control_index, meta_network_name, meta_client_name);

ALTER TABLE libp2p_rpc_meta_control_graft_local ON CLUSTER '{cluster}'
Expand Down Expand Up @@ -479,6 +484,7 @@ CREATE TABLE libp2p_rpc_meta_control_prune_local ON CLUSTER '{cluster}'
meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)),
meta_network_name LowCardinality(String)
) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time)
PARTITION BY toYYYYMM(event_date_time)
ORDER BY (event_date_time, unique_key, control_index, meta_network_name, meta_client_name);

ALTER TABLE libp2p_rpc_meta_control_prune_local ON CLUSTER '{cluster}'
Expand Down

0 comments on commit 7acb6e8

Please sign in to comment.