[UserFeedback] Fix body search timing out

This somehow worked without the index previously.
This commit is contained in:
Earlopain 2023-03-14 18:59:41 +01:00
parent d4389b756d
commit 0faf1fa1a3
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897
2 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,5 @@
class UserFeedbackBody < ActiveRecord::Migration[7.0]
def change
add_index :user_feedback, "to_tsvector('english', body)", using: :gin
end
end

View File

@ -4193,6 +4193,13 @@ CREATE INDEX index_user_feedback_on_creator_id ON public.user_feedback USING btr
CREATE INDEX index_user_feedback_on_creator_ip_addr ON public.user_feedback USING btree (creator_ip_addr);
--
-- Name: index_user_feedback_on_to_tsvector_english_body; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_user_feedback_on_to_tsvector_english_body ON public.user_feedback USING gin (to_tsvector('english'::regconfig, body));
--
-- Name: index_user_feedback_on_user_id; Type: INDEX; Schema: public; Owner: -
--
@ -4619,6 +4626,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20230221145226'),
('20230221153458'),
('20230226152600'),
('20230312103728');
('20230312103728'),
('20230314170352');