Commit 032340efaa81c9401a97f423dab582f52dedde69
1 parent
17021ea5
Exists in
master
and in
1 other branch
Some indexes to boost performance.
Showing
2 changed files
with
8 additions
and
1 deletions
Show diff stats
app/models/err.rb
app/models/notice.rb
... | ... | @@ -13,8 +13,14 @@ class Notice |
13 | 13 | field :klass |
14 | 14 | |
15 | 15 | belongs_to :err |
16 | - index :err_id | |
17 | 16 | index :created_at |
17 | + index( | |
18 | + [ | |
19 | + [ :err_id, Mongo::ASCENDING ], | |
20 | + [ :created_at, Mongo::ASCENDING ], | |
21 | + [ :_id, Mongo::ASCENDING ] | |
22 | + ] | |
23 | + ) | |
18 | 24 | |
19 | 25 | after_create :increase_counter_cache, :cache_attributes_on_problem, :unresolve_problem |
20 | 26 | after_create :deliver_notification, :if => :should_notify? | ... | ... |