Commit 633b52cb3f3ac13a9a8db16003fa479f501285ec
Committed by
Rodrigo Souto
1 parent
56965b04
Exists in
master
and in
22 other branches
Speed up articles fetch
Showing
1 changed file
with
13 additions
and
0 deletions
Show diff stats
db/migrate/20140708121356_index_articles_filtered_fields.rb
0 → 100644
| @@ -0,0 +1,13 @@ | @@ -0,0 +1,13 @@ | ||
| 1 | +class IndexArticlesFilteredFields < ActiveRecord::Migration | ||
| 2 | + def self.up | ||
| 3 | + %w[articles article_versions].each do |table| | ||
| 4 | + add_index table, [:parent_id] | ||
| 5 | + add_index table, [:path] | ||
| 6 | + add_index table, [:path, :profile_id] | ||
| 7 | + end | ||
| 8 | + add_index :articles, [:type] | ||
| 9 | + add_index :articles, [:type, :parent_id] | ||
| 10 | + add_index :articles, [:type, :profile_id] | ||
| 11 | + end | ||
| 12 | + | ||
| 13 | +end |