Skip to content

Commit

Permalink
Merge pull request #164 from SigNoz/issue_2594
Browse files Browse the repository at this point in the history
feat: add default indices for top level keys
  • Loading branch information
nityanandagohain authored Aug 23, 2023
2 parents dc03b7c + cf1cdf3 commit 0aa6206
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
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;
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;

0 comments on commit 0aa6206

Please sign in to comment.