add prefix index on tags (#3858)

This commit is contained in:
Albert Yi
2018-09-12 14:01:21 -07:00
parent f487b2a2c6
commit 8c564f055f
3 changed files with 16 additions and 3 deletions

View File

@@ -7128,6 +7128,13 @@ CREATE UNIQUE INDEX index_tags_on_name ON public.tags USING btree (name);
CREATE INDEX index_tags_on_name_pattern ON public.tags USING btree (name text_pattern_ops);
--
-- Name: index_tags_on_name_prefix; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_tags_on_name_prefix ON public.tags USING gin (regexp_replace((name)::text, '([a-z0-9])[a-z0-9'']*($|[^a-z0-9'']+)'::text, ''::text, 'g'::text) public.gin_trgm_ops) WHERE (post_count > 0);
--
-- Name: index_tags_on_name_trgm; Type: INDEX; Schema: public; Owner: -
--
@@ -7524,6 +7531,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20180517190048'),
('20180518175154'),
('20180804203201'),
('20180816230604');
('20180816230604'),
('20180912185624');