mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
PERF: reverse index on topic users to speed up join
This commit is contained in:
parent
ca2100d012
commit
af75360942
6
db/migrate/20140910130155_create_topic_user_index.rb
Normal file
6
db/migrate/20140910130155_create_topic_user_index.rb
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user