Updating table index and tsvector creation

This commit is contained in:
farhan 2021-02-03 01:28:27 +00:00
parent 9dabd87f06
commit 6efd723aac

View File

@ -29,9 +29,16 @@ CREATE TABLE instances (
software VARCHAR(50) software VARCHAR(50)
); );
ALTER TABLE activities ADD COLUMN normalized_idx tsvector; -- ALTER TABLE activities ADD COLUMN normalized_tsvector tsvector;
UPDATE activities SET normalized_idx = to_tsvector('english', normalized); -- UPDATE activities SET normalized_tsvector = to_tsvector('english', normalized);
CREATE INDEX ON activities USING gin(normalized_idx);
ALTER TABLE activities
ADD normalized_tsvector tsvector
GENERATED ALWAYS AS (to_tsvector('english', normalized)) STORED;
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);