There was an error while loading. Please reload this page.
1 parent e76cbc0 commit 175f143Copy full SHA for 175f143
1 file changed
internal-packages/clickhouse/schema/047_add_task_events_v2_trace_id_index.sql
@@ -0,0 +1,13 @@
1
+-- +goose Up
2
+-- Bloom-filter skip index on trace_id (the trailing ORDER BY column) so a
3
+-- single-trace read prunes to the trace's footprint, matching the existing
4
+-- run_id / span_id indexes. Metadata-only: ADD INDEX covers new parts only (no
5
+-- MATERIALIZE), so existing parts stay indexed only once they merge or age out
6
+-- under retention -- coverage ramps in, it is not immediate. See the PR for the
7
+-- rollout-window details.
8
+ALTER TABLE trigger_dev.task_events_v2
9
+ ADD INDEX IF NOT EXISTS idx_trace_id trace_id TYPE bloom_filter(0.001) GRANULARITY 1;
10
+
11
+-- +goose Down
12
13
+ DROP INDEX IF EXISTS idx_trace_id;
0 commit comments