Skip to content

Commit

Permalink
PERF: reverse index on topic users to speed up join
Browse files Browse the repository at this point in the history
  • Loading branch information
SamSaffron committed Sep 10, 2014
1 parent ca2100d commit af75360
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions db/migrate/20140910130155_create_topic_user_index.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class CreateTopicUserIndex < ActiveRecord::Migration
def change
# seems to be the most effective for joining into topics
add_index :topic_users, [:user_id, :topic_id], unique: true
end
end

0 comments on commit af75360

Please sign in to comment.