diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2015-10-20 17:56:29 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2015-10-29 14:09:25 +0300 |
commit | 7fc95d805dd2a4b997bbc3ad24a1a3a7d64ef305 (patch) | |
tree | e8b8e2b22d6421e255090cdb1d6170545e7d6a5a | |
parent | ead3ffd7a516911458d84311c4f1b4153f1071b5 (diff) |
Added index on services.template
This column is queried when creating a new project, without an index
this query would lead to a sequence scan.
-rw-r--r-- | db/migrate/20151020145526_add_services_template_index.rb | 5 | ||||
-rw-r--r-- | db/schema.rb | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/db/migrate/20151020145526_add_services_template_index.rb b/db/migrate/20151020145526_add_services_template_index.rb new file mode 100644 index 00000000000..1b04f313565 --- /dev/null +++ b/db/migrate/20151020145526_add_services_template_index.rb @@ -0,0 +1,5 @@ +class AddServicesTemplateIndex < ActiveRecord::Migration + def change + add_index :services, :template + end +end diff --git a/db/schema.rb b/db/schema.rb index 4bde9f0b748..73fc83c3d6b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -667,6 +667,7 @@ ActiveRecord::Schema.define(version: 20151026182941) do add_index "services", ["created_at", "id"], name: "index_services_on_created_at_and_id", using: :btree add_index "services", ["project_id"], name: "index_services_on_project_id", using: :btree + add_index "services", ["template"], name: "index_services_on_template", using: :btree create_table "snippets", force: true do |t| t.string "title" |