On existing DB, run:
-- Enable the pg_trgm extension if not already enabled
CREATE EXTENSION IF NOT EXISTS pg_trgm;
-- Create trigram GIN indexes (CONCURRENTLY avoids locking the table)
-- Note: CONCURRENTLY cannot be run inside a transaction block
CREATE INDEX CONCURRENTLY ix_resource_key_trgm ON resource USING GIN (key gin_trgm_ops);
CREATE INDEX CONCURRENTLY ix_resource_label_trgm ON resource USING GIN (label gin_trgm_ops);
CREATE INDEX CONCURRENTLY ix_resource_type_trgm ON resource USING GIN (type gin_trgm_ops);
On existing DB, run:
-- Enable the pg_trgm extension if not already enabled
CREATE EXTENSION IF NOT EXISTS pg_trgm;
-- Create trigram GIN indexes (CONCURRENTLY avoids locking the table)
-- Note: CONCURRENTLY cannot be run inside a transaction block
CREATE INDEX CONCURRENTLY ix_resource_key_trgm ON resource USING GIN (key gin_trgm_ops);
CREATE INDEX CONCURRENTLY ix_resource_label_trgm ON resource USING GIN (label gin_trgm_ops);
CREATE INDEX CONCURRENTLY ix_resource_type_trgm ON resource USING GIN (type gin_trgm_ops);