diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-10-28 18:33:55 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-10-28 18:33:55 +0200 |
commit | 8f14f353bf68e5ba8b32f2252b445d0609a0285d (patch) | |
tree | ebc484da414607bb04a595fb9eedd602d32bacb1 /db | |
parent | fb2a5995a9b4e67066dd2bda3a26020b75b538a3 (diff) | |
download | gitlab-ci-8f14f353bf68e5ba8b32f2252b445d0609a0285d.tar.gz |
Add indicies for better performance
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20141028162820_add_sha_index_to_build.rb | 6 | ||||
-rw-r--r-- | db/schema.rb | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/db/migrate/20141028162820_add_sha_index_to_build.rb b/db/migrate/20141028162820_add_sha_index_to_build.rb new file mode 100644 index 0000000..bd2a4de --- /dev/null +++ b/db/migrate/20141028162820_add_sha_index_to_build.rb @@ -0,0 +1,6 @@ +class AddShaIndexToBuild < ActiveRecord::Migration + def change + add_index :builds, :sha + add_index :builds, [:project_id, :sha] + end +end diff --git a/db/schema.rb b/db/schema.rb index 67d0a73..5769a3e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20141001132129) do +ActiveRecord::Schema.define(version: 20141028162820) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -33,8 +33,10 @@ ActiveRecord::Schema.define(version: 20141001132129) do t.float "coverage" end + add_index "builds", ["project_id", "sha"], name: "index_builds_on_project_id_and_sha", using: :btree add_index "builds", ["project_id"], name: "index_builds_on_project_id", using: :btree add_index "builds", ["runner_id"], name: "index_builds_on_runner_id", using: :btree + add_index "builds", ["sha"], name: "index_builds_on_sha", using: :btree create_table "projects", force: true do |t| t.string "name", null: false |