updated indexes yet again

This commit is contained in:
farhan 2021-02-13 02:46:32 +00:00
parent d4ef1561d4
commit 5a481121d2

View File

@ -13,6 +13,7 @@ CREATE TABLE activities (
id SERIAL PRIMARY KEY, id SERIAL PRIMARY KEY,
document JSONB, document JSONB,
normalized TEXT, normalized TEXT,
identifiedat TIMESTAMP with time zone DEFAULT now(),
instance VARCHAR(1000) NOT NULL instance VARCHAR(1000) NOT NULL
); );
@ -34,10 +35,14 @@ ALTER TABLE activities
GENERATED ALWAYS AS (to_tsvector('english', normalized)) STORED; 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 normalized_idx ON activities USING gin(normalized_tsvector);
CREATE INDEX actors_id_idx ON actors (id); CREATE INDEX actors_id_idx ON actors (id);
CREATE INDEX activities_id_idx ON activities (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') );