added indexes

This commit is contained in:
albert
2012-01-18 16:59:06 -05:00
parent 4283bce8b9
commit 2e4d417de1
4 changed files with 7 additions and 1 deletions

View File

@@ -67,7 +67,8 @@ class CreatePosts < ActiveRecord::Migration
add_index :posts, :parent_id
add_index :posts, :uploader_id
add_index :posts, :uploader_ip_addr
execute "create index index_posts_on_source_pattern on posts (source text_pattern_ops)"
execute "create index index_posts_on_created_at_date on posts (date(created_at))"
execute "CREATE INDEX index_posts_on_mpixels ON posts (((image_width * image_height)::numeric / 1000000.0))"