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.
This commit is contained in:
Yorick Peterse
2015-10-29 12:09:25 +01:00
parent ead3ffd7a5
commit 7fc95d805d
2 changed files with 6 additions and 0 deletions
@@ -0,0 +1,5 @@
class AddServicesTemplateIndex < ActiveRecord::Migration
def change
add_index :services, :template
end
end
+1
View File
@@ -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"