diff options
author | Stan Hu <stanhu@gmail.com> | 2019-08-05 06:42:49 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-08-05 06:42:49 -0700 |
commit | 344f07e9361008412b3c22f1bc5e56dc2924ada9 (patch) | |
tree | eec0aeb0794e377f15c50129f5cca428f69f3f39 /db/schema.rb | |
parent | fbd5a6c6cc1e8541096e0118868a2d83a0d91996 (diff) | |
download | gitlab-ce-344f07e9361008412b3c22f1bc5e56dc2924ada9.tar.gz |
Add partial index for deploy keys
Per https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31384, this
appears to drop the runtime of the query from 1.2 ms (cold), 500ms (warm
cache) to < 20 ms.
Diffstat (limited to 'db/schema.rb')
-rw-r--r-- | db/schema.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/db/schema.rb b/db/schema.rb index a9b7c1930e3..07e479dabc6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_08_02_012622) do +ActiveRecord::Schema.define(version: 2019_08_02_235445) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -1770,6 +1770,7 @@ ActiveRecord::Schema.define(version: 2019_08_02_012622) do t.boolean "public", default: false, null: false t.datetime "last_used_at" t.index ["fingerprint"], name: "index_keys_on_fingerprint", unique: true + t.index ["id", "type"], name: "index_on_deploy_keys_id_and_type_and_public", unique: true, where: "(public = true)" t.index ["user_id"], name: "index_keys_on_user_id" end |