Added database indexes. Performance boost for balance page.

This commit is contained in:
benni 2012-05-28 10:41:33 +02:00
parent 6bd4bbec86
commit 218f40eb8d
2 changed files with 22 additions and 7 deletions

View file

@ -0,0 +1,11 @@
class AddOrderIndexes < ActiveRecord::Migration
def self.up
add_index :group_order_articles, :group_order_id
add_index :group_order_articles, :order_article_id
end
def self.down
remove_index :group_order_articles, :group_order_id
remove_index :group_order_articles, :order_article_id
end
end

View file

@ -1,15 +1,17 @@
# This file is auto-generated from the current state of the database. Instead of editing this file,
# please use the migrations feature of Active Record to incrementally modify your database, and
# then regenerate this schema definition.
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your database schema. If you need
# to create the application database on another system, you should be using db:schema:load, not running
# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20110507192928) do
ActiveRecord::Schema.define(:version => 20120512211613) do
create_table "article_categories", :force => true do |t|
t.string "name", :default => "", :null => false
@ -114,6 +116,8 @@ ActiveRecord::Schema.define(:version => 20110507192928) do
end
add_index "group_order_articles", ["group_order_id", "order_article_id"], :name => "goa_index", :unique => true
add_index "group_order_articles", ["group_order_id"], :name => "index_group_order_articles_on_group_order_id"
add_index "group_order_articles", ["order_article_id"], :name => "index_group_order_articles_on_order_article_id"
create_table "group_orders", :force => true do |t|
t.integer "ordergroup_id", :default => 0, :null => false