tags: add trigram index on tag names.

This commit is contained in:
evazion 2017-11-27 13:52:48 -06:00
parent 44f4befa5a
commit dd8e3bbb94
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,9 @@
class AddTrigramIndexToTags < ActiveRecord::Migration
def up
execute "create index index_tags_on_name_trgm on tags using gin (name gin_trgm_ops)"
end
def down
execute "drop index index_tags_on_name_trgm"
end
end

View File

@ -7008,6 +7008,13 @@ CREATE UNIQUE INDEX index_tags_on_name ON tags USING btree (name);
CREATE INDEX index_tags_on_name_pattern ON tags USING btree (name text_pattern_ops);
--
-- Name: index_tags_on_name_trgm; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_tags_on_name_trgm ON tags USING gin (name gin_trgm_ops);
--
-- Name: index_token_buckets_on_user_id; Type: INDEX; Schema: public; Owner: -
--
@ -7521,3 +7528,5 @@ INSERT INTO schema_migrations (version) VALUES ('20170914200122');
INSERT INTO schema_migrations (version) VALUES ('20171106075030');
INSERT INTO schema_migrations (version) VALUES ('20171127195124');