summaryrefslogtreecommitdiff
path: root/db/schema.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-11-24 10:11:37 +0000
committerSean McGivern <sean@gitlab.com>2017-11-28 16:13:57 +0000
commit484ae2ee2db58a641d3c3fff36f46b431ce450df (patch)
treec5124b9b841b0d0a649a1d6bc1c82d2bc9d200db /db/schema.rb
parent4ebbfe5d3e0dbe06346ee0c64a8f62ec11f9b6e8 (diff)
downloadgitlab-ce-484ae2ee2db58a641d3c3fff36f46b431ce450df.tar.gz
Improve indexes on merge_request_diffsremove-mr-diff-serialised-columns
For getting the SHAs from an MR to find pipelines, we get the last 100 MR diffs for the MR, and find commits from those. This was un-indexed before, because the index was not a composite index on merge_request_diff_id, id. Changing that means that this scope can exclusively use indexes.
Diffstat (limited to 'db/schema.rb')
-rw-r--r--db/schema.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/db/schema.rb b/db/schema.rb
index 292163ee9bf..339c98d7798 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1020,7 +1020,7 @@ ActiveRecord::Schema.define(version: 20171124132536) do
t.string "start_commit_sha"
end
- add_index "merge_request_diffs", ["merge_request_id"], name: "index_merge_request_diffs_on_merge_request_id", using: :btree
+ add_index "merge_request_diffs", ["merge_request_id", "id"], name: "index_merge_request_diffs_on_merge_request_id_and_id", using: :btree
create_table "merge_request_metrics", force: :cascade do |t|
t.integer "merge_request_id", null: false