From: Tom Hughes Date: Tue, 1 Feb 2022 18:42:07 +0000 (+0000) Subject: Index note comments by author and date X-Git-Tag: live~1393 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/7d535252199b4a106272e4a77bd050132fca893e?hp=5cb7fbb3d17a39f8fe130e3a9a5f9e43484574a2 Index note comments by author and date Fixes #3443 --- diff --git a/db/migrate/20220201183346_add_author_index_to_note_comments.rb b/db/migrate/20220201183346_add_author_index_to_note_comments.rb new file mode 100644 index 000000000..57f1f064b --- /dev/null +++ b/db/migrate/20220201183346_add_author_index_to_note_comments.rb @@ -0,0 +1,7 @@ +class AddAuthorIndexToNoteComments < ActiveRecord::Migration[6.1] + disable_ddl_transaction! + + def change + add_index :note_comments, [:author_id, :created_at], :algorithm => :concurrently + end +end diff --git a/db/structure.sql b/db/structure.sql index e50e50278..7c182189c 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -2515,6 +2515,13 @@ CREATE INDEX index_issues_on_status ON public.issues USING btree (status); CREATE INDEX index_issues_on_updated_by ON public.issues USING btree (updated_by); +-- +-- Name: index_note_comments_on_author_id_and_created_at; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_note_comments_on_author_id_and_created_at ON public.note_comments USING btree (author_id, created_at); + + -- -- Name: index_note_comments_on_body; Type: INDEX; Schema: public; Owner: - -- @@ -3425,6 +3432,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20210510083027'), ('20210510083028'), ('20210511104518'), +('20220201183346'), ('21'), ('22'), ('23'),