-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from SigNoz/issue_2594
feat: add default indices for top level keys
- Loading branch information
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
exporter/clickhouselogsexporter/migrations/000007_default_indexes.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ALTER TABLE signoz_logs.logs ON CLUSTER cluster drop index IF EXISTS severity_number_idx; | ||
|
||
ALTER TABLE signoz_logs.logs ON CLUSTER cluster drop index IF EXISTS severity_text_idx; | ||
|
||
ALTER TABLE signoz_logs.logs ON CLUSTER cluster drop index IF EXISTS trace_flags_idx; |
12 changes: 12 additions & 0 deletions
12
exporter/clickhouselogsexporter/migrations/000007_default_indexes.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- This migration adds default indexes to top level keys of the log model | ||
|
||
-- https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-severitynumber range 1-24 and 0 means it's not set | ||
ALTER TABLE signoz_logs.logs ON CLUSTER cluster add index IF NOT EXISTS severity_number_idx (severity_number) TYPE set(25) GRANULARITY 4; | ||
|
||
-- https://opentelemetry.io/docs/specs/otel/logs/data-model/#displaying-severity 24 different values and empty means not set. | ||
ALTER TABLE signoz_logs.logs ON CLUSTER cluster add index IF NOT EXISTS severity_text_idx (severity_text) TYPE set(25) GRANULARITY 4; | ||
|
||
|
||
-- No point in addding index for trace_id, span_id as they are not set and they are always unique | ||
-- trace_flags can be a set so adding a default bloom filter | ||
ALTER TABLE signoz_logs.logs ON CLUSTER cluster add index IF NOT EXISTS trace_flags_idx (trace_flags) TYPE bloom_filter() GRANULARITY 4; |