From 22d9183f4be91ec31cadd46f0932064eb7343a31 Mon Sep 17 00:00:00 2001 From: Ankit Nayan Date: Sun, 8 Sep 2024 19:47:25 +0530 Subject: [PATCH] Chore/change resourcemap index (#365) change the type of index for resource attributes from `bloom_filter` to `tokenbf_v1` for keys and `ngrambf_v1` for values. This is tested and implemented in logs already. --- .../migrations/000031_change_resource_index.down.sql | 8 ++++++++ .../traces/migrations/000031_change_resource_index.up.sql | 3 +++ 2 files changed, 11 insertions(+) create mode 100644 migrationmanager/migrators/traces/migrations/000031_change_resource_index.down.sql create mode 100644 migrationmanager/migrators/traces/migrations/000031_change_resource_index.up.sql diff --git a/migrationmanager/migrators/traces/migrations/000031_change_resource_index.down.sql b/migrationmanager/migrators/traces/migrations/000031_change_resource_index.down.sql new file mode 100644 index 00000000..2200f903 --- /dev/null +++ b/migrationmanager/migrators/traces/migrations/000031_change_resource_index.down.sql @@ -0,0 +1,8 @@ +ALTER TABLE signoz_traces.signoz_index_v2 ON CLUSTER {{.SIGNOZ_CLUSTER}} + DROP INDEX IF EXISTS idx_resourceTagMapKeys, + DROP INDEX IF EXISTS idx_resourceTagMapValues, + + ADD INDEX IF NOT EXISTS idx_resourceTagsMapKeys mapKeys(resourceTagsMap) TYPE bloom_filter(0.01) GRANULARITY 64, + ADD INDEX IF NOT EXISTS idx_resourceTagsMapValues mapValues(resourceTagsMap) TYPE bloom_filter(0.01) GRANULARITY 64; + + diff --git a/migrationmanager/migrators/traces/migrations/000031_change_resource_index.up.sql b/migrationmanager/migrators/traces/migrations/000031_change_resource_index.up.sql new file mode 100644 index 00000000..c6fac2b3 --- /dev/null +++ b/migrationmanager/migrators/traces/migrations/000031_change_resource_index.up.sql @@ -0,0 +1,3 @@ +ALTER TABLE signoz_traces.signoz_index_v2 ON CLUSTER {{.SIGNOZ_CLUSTER}} + ADD INDEX IF NOT EXISTS idx_resourceTagMapKeys mapKeys(resourceTagsMap) TYPE tokenbf_v1(1024, 2, 0) GRANULARITY 1, + ADD INDEX IF NOT EXISTS idx_resourceTagMapValues mapValues(resourceTagsMap) TYPE ngrambf_v1(4, 5000, 2, 0) GRANULARITY 1;