Skip to content

A platform for community discussion. Free, open, simple.

PERF: index on topic_id for user_histories table

Sam37088c4221bb
diff --git a/db/migrate/20190106041015_add_topic_id_index_to_user_histories.rb b/db/migrate/20190106041015_add_topic_id_index_to_user_histories.rb
new file mode 100644
index 00000000000..8172657fb10
--- /dev/null
+++ b/db/migrate/20190106041015_add_topic_id_index_to_user_histories.rb
@@ -0,0 +1,5 @@
+class AddTopicIdIndexToUserHistories < ActiveRecord::Migration[5.2]
+ def change
+ add_index :user_histories, [:topic_id, :target_user_id, :action]
+ end
+end