diff --git a/migrationmanager/migrators/traces/migrations/000030_add_attributes_indices.down.sql b/migrationmanager/migrators/traces/migrations/000030_add_attributes_indices.down.sql new file mode 100644 index 00000000..2a60ab8c --- /dev/null +++ b/migrationmanager/migrators/traces/migrations/000030_add_attributes_indices.down.sql @@ -0,0 +1,8 @@ +ALTER TABLE signoz_traces.signoz_index_v2 ON CLUSTER {{.SIGNOZ_CLUSTER}} + DROP INDEX IF EXISTS idx_stringTagMapKeys, + DROP INDEX IF EXISTS idx_stringTagMapValues, + + DROP INDEX IF EXISTS idx_numberTagMapKeys, + DROP INDEX IF EXISTS idx_numberTagMapValues, + + DROP INDEX IF EXISTS idx_boolTagMapKeys; \ No newline at end of file diff --git a/migrationmanager/migrators/traces/migrations/000030_add_attributes_indices.up.sql b/migrationmanager/migrators/traces/migrations/000030_add_attributes_indices.up.sql new file mode 100644 index 00000000..63be150e --- /dev/null +++ b/migrationmanager/migrators/traces/migrations/000030_add_attributes_indices.up.sql @@ -0,0 +1,8 @@ +ALTER TABLE signoz_traces.signoz_index_v2 ON CLUSTER {{.SIGNOZ_CLUSTER}} + ADD INDEX IF NOT EXISTS idx_stringTagMapKeys mapKeys(stringTagMap) TYPE tokenbf_v1(1024, 2, 0) GRANULARITY 1, + ADD INDEX IF NOT EXISTS idx_stringTagMapValues mapValues(stringTagMap) TYPE ngrambf_v1(4, 5000, 2, 0) GRANULARITY 1, + + ADD INDEX IF NOT EXISTS idx_numberTagMapValues mapKeys(numberTagMap) TYPE tokenbf_v1(1024, 2, 0) GRANULARITY 1, + ADD INDEX IF NOT EXISTS idx_numberTagMapValues mapValues(numberTagMap) TYPE bloom_filter(0.01) GRANULARITY 1, + + ADD INDEX IF NOT EXISTS idx_boolTagMapKeys mapKeys(boolTagMap) TYPE tokenbf_v1(1024, 2, 0) GRANULARITY 1; 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;