12345678910111213141516171819202122 |
- create database if not exists otel_cold on cluster default;
- use otel_cold;
- create table if not exists otel_cold.sample_hit_trace_local on cluster default
- (
- trace_id String not null,
- timestamp bigint not null,
- INDEX idx_timestamp timestamp type minmax granularity 1
- )
- ENGINE = ReplicatedMergeTree('/clickhouse/otel_cold/tables/{shard}/sample_hit_trace_local', '{replica}')
- partition by (toDate(fromUnixTimestamp64Milli(timestamp)))
- ttl toDateTime(fromUnixTimestamp64Milli(timestamp)) + interval 24 hour
- order by (timestamp)
- settings index_granularity = 8192, ttl_only_drop_parts = 1;
- CREATE TABLE if not exists otel_cold.sample_hit_trace on cluster default
- (
- `trace_id` String,
- `timestamp` bigint
- )
- ENGINE = Distributed('default', 'otel_cold', 'sample_hit_trace_local', rand());
|