From 5a481121d2d9c10ad7d3c6f4b31cf164e12aaab2 Mon Sep 17 00:00:00 2001 From: Farhan Khan Date: Sat, 13 Feb 2021 02:46:32 +0000 Subject: [PATCH] updated indexes yet again --- fedilogue/tables.sql | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fedilogue/tables.sql b/fedilogue/tables.sql index 2059b38..6ca61fd 100644 --- a/fedilogue/tables.sql +++ b/fedilogue/tables.sql @@ -13,6 +13,7 @@ CREATE TABLE activities ( id SERIAL PRIMARY KEY, document JSONB, normalized TEXT, + identifiedat TIMESTAMP with time zone DEFAULT now(), instance VARCHAR(1000) NOT NULL ); @@ -34,10 +35,14 @@ ALTER TABLE activities GENERATED ALWAYS AS (to_tsvector('english', normalized)) STORED; +CREATE UNIQUE INDEX actors_uri_idx ON actors ( (document->>'id') ); +CREATE UNIQUE INDEX activities_uri_idx ON activities ( (document->>'id') ); + +CREATE INDEX activities_published_idx ON activities ( (document->>'published') ); +CREATE INDEX activities_identifiedat_idx ON activities (identifiedat); CREATE INDEX normalized_idx ON activities USING gin(normalized_tsvector); CREATE INDEX actors_id_idx ON actors (id); CREATE INDEX activities_id_idx ON activities (id); -CREATE UNIQUE INDEX actors_uri_idx ON actors ( (document->>'id') ); -CREATE UNIQUE INDEX activities_uri_idx ON activities ( (document->>'id') ); +