From 48571cae37a2201580f1a706544f002b19ba9c6f Mon Sep 17 00:00:00 2001 From: Christophe Date: Fri, 30 Mar 2012 12:43:51 +0200 Subject: [PATCH] Indexes on participation table --- db/migrate/20120330103021_indexes_on_participation.rb | 6 ++++++ db/schema.rb | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20120330103021_indexes_on_participation.rb diff --git a/db/migrate/20120330103021_indexes_on_participation.rb b/db/migrate/20120330103021_indexes_on_participation.rb new file mode 100644 index 000000000..4535aa2d3 --- /dev/null +++ b/db/migrate/20120330103021_indexes_on_participation.rb @@ -0,0 +1,6 @@ +class IndexesOnParticipation < ActiveRecord::Migration + def change + add_index(:participations, [:target_id, :target_type, :author_id]) + add_index(:participations, :guid) + end +end diff --git a/db/schema.rb b/db/schema.rb index 763db208c..7e9fff21b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20120328025842) do +ActiveRecord::Schema.define(:version => 20120330144057) do create_table "account_deletions", :force => true do |t| t.string "diaspora_handle" @@ -262,6 +262,9 @@ ActiveRecord::Schema.define(:version => 20120328025842) do t.datetime "updated_at" end + add_index "participations", ["guid"], :name => "index_participations_on_guid" + add_index "participations", ["target_id", "target_type", "author_id"], :name => "index_participations_on_target_id_and_target_type_and_author_id" + create_table "people", :force => true do |t| t.string "guid", :null => false t.text "url", :null => false @@ -340,6 +343,7 @@ ActiveRecord::Schema.define(:version => 20120328025842) do add_index "posts", ["author_id", "root_guid"], :name => "index_posts_on_author_id_and_root_guid", :unique => true add_index "posts", ["author_id"], :name => "index_posts_on_person_id" add_index "posts", ["guid"], :name => "index_posts_on_guid", :unique => true + add_index "posts", ["id", "type", "created_at"], :name => "index_posts_on_id_and_type_and_created_at" add_index "posts", ["root_guid"], :name => "index_posts_on_root_guid" add_index "posts", ["status_message_guid", "pending"], :name => "index_posts_on_status_message_guid_and_pending" add_index "posts", ["status_message_guid"], :name => "index_posts_on_status_message_guid"