From e065d20de619aed5196973b1fc9e14902bf8ead3 Mon Sep 17 00:00:00 2001 From: The Lone Ronin Date: Thu, 8 Apr 2021 13:55:29 -0400 Subject: [PATCH] Improve indices --- bin/index.create.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/index.create.sh b/bin/index.create.sh index 1676619..b1254b9 100644 --- a/bin/index.create.sh +++ b/bin/index.create.sh @@ -24,10 +24,10 @@ CREATE INDEX "index_domain_transactions" ON transactions USING BTREE ("domain"); CREATE INDEX "index_app_transactions" ON transactions USING BTREE ("app"); CREATE INDEX "index_App-Name_transactions" ON transactions USING BTREE ("App-Name"); -CREATE INDEX "tags_name" ON tags USING BTREE ("name"); -CREATE INDEX "tags_value" ON tags USING BTREE ("value"); -CREATE INDEX "tags_name_value" ON tags USING BTREE ("name", "value"); -CREATE INDEX "tags_tx_id_name" ON tags USING BTREE ("tx_id", "name"); +CREATE INDEX "tags_name" ON tags USING BTREE ("name") WHERE LENGTH("name") < 64; +CREATE INDEX "tags_value" ON tags USING BTREE ("value") WHERE LENGTH("value") < 64; +CREATE INDEX "tags_name_value" ON tags USING BTREE ("name", "value") WHERE LENGTH("name") < 64 AND LENGTH("value") < 64; +CREATE INDEX "tags_tx_id_name" ON tags USING BTREE ("tx_id", "name") WHERE LENGTH("name") < 64; EOF