Skip to content

Commit 175f143

Browse files
MariefayTrigger.dev RepoOps
authored andcommitted
perf(clickhouse): add task_events_v2 trace_id bloom-filter skip index
Mono-RevId: 507cf22bb577a9a495820c9028bc7cd7a0c7fede
1 parent e76cbc0 commit 175f143

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
ALTER TABLE trigger_dev.task_events_v2
13+
DROP INDEX IF EXISTS idx_trace_id;

0 commit comments

Comments
 (0)