diff --git a/lib/db/maintain/scripts.js b/lib/db/maintain/scripts.js index 02300669..5ad41cc4 100644 --- a/lib/db/maintain/scripts.js +++ b/lib/db/maintain/scripts.js @@ -345,21 +345,23 @@ module.exports.profiles_dist = [ `CREATE TABLE IF NOT EXISTS profiles_series {{{OnCluster}}} ( date Date, + type_id LowCardinality(String), fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), tags Array(Tuple(String, String)) CODEC(ZSTD(1)), ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles',fingerprint);`, - `CREATE TABLE IF NOT EXISTS profiles_series_gin {{{OnCluster}}} ( + `CREATE TABLE IF NOT EXISTS profiles_series_gin_dist {{{OnCluster}}} ( date Date, key String, val String, + type_id LowCardinality(String), fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), - ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles',fingerprint);`, + ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles_series_gin',fingerprint);`, - `CREATE TABLE IF NOT EXISTS profiles_series_keys {{{OnCluster}}} ( + `CREATE TABLE IF NOT EXISTS profiles_series_keys_dist {{{OnCluster}}} ( date Date, key String, val String, val_id UInt64, - ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles', rand());` + ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles_series_keys', rand());` ]