Skip to content

Commit 64f0506

Browse files
committed
Add Data Skipping Indicies To Spans Table
Signed-off-by: Mahad Zaryab <[email protected]>
1 parent a54a36e commit 64f0506

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

internal/storage/v2/clickhouse/sql/create_spans_table.sql

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,12 @@ CREATE TABLE
4747
scope_int_attributes Nested (key String, value Int64),
4848
scope_str_attributes Nested (key String, value String),
4949
scope_complex_attributes Nested (key String, value String),
50-
) ENGINE = MergeTree PRIMARY KEY (trace_id)
50+
INDEX idx_service_name service_name TYPE set(500) GRANULARITY 1,
51+
INDEX idx_name name TYPE set(1000) GRANULARITY 1,
52+
INDEX idx_start_time start_time TYPE minmax GRANULARITY 1,
53+
INDEX idx_duration TYPE minmax GRANULARITY 1,
54+
INDEX idx_attributes_keys str_attributes.key TYPE bloom_filter GRANULARITY 1,
55+
INDEX idx_attributes_values str_attributes.value TYPE bloom_filter GRANULARITY 1,
56+
) ENGINE = MergeTree
57+
PARTITION BY toDate(start_time)
58+
ORDER BY (trace_id)

0 commit comments

Comments
 (0)