]> git.openstreetmap.org Git - rails.git/commitdiff
Index note comments by author and date
authorTom Hughes <tom@compton.nu>
Tue, 1 Feb 2022 18:42:07 +0000 (18:42 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 1 Feb 2022 18:48:18 +0000 (18:48 +0000)
Fixes #3443

db/migrate/20220201183346_add_author_index_to_note_comments.rb [new file with mode: 0644]
db/structure.sql

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 (file)
index 0000000..57f1f06
--- /dev/null
@@ -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
index e50e502780005f642df389832979759e3d873d38..7c182189c2de3b9de55ecea84601bf42e4bd2d33 100644 (file)
@@ -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'),