From 1e97a6df24f66f70811fdd4b1412432e40ab8ebe Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sat, 4 Feb 2017 10:20:39 -0800 Subject: Add index to labels for `type` and project_id` When loading pages that display the number of open issues, the backend runs a query such as: ```sql SELECT "labels"."id" FROM "labels" WHERE "labels"."type" IN ('ProjectLabel') AND "labels"."project_id" = 1000 ``` This results in an entire scan of the `labels` table. To optimize performance, add the appropriate index to the table. Closes #27676 --- db/schema.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index c73c311ccb2..92b36218a15 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: 20170130204620) do +ActiveRecord::Schema.define(version: 20170204181513) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -576,6 +576,7 @@ ActiveRecord::Schema.define(version: 20170130204620) do end add_index "labels", ["group_id", "project_id", "title"], name: "index_labels_on_group_id_and_project_id_and_title", unique: true, using: :btree + add_index "labels", ["type", "project_id"], name: "index_labels_on_type_and_project_id", using: :btree create_table "lfs_objects", force: :cascade do |t| t.string "oid", null: false -- cgit v1.2.1 From 5d3816652e13cde6bf5e9de814d2c9d1e6593601 Mon Sep 17 00:00:00 2001 From: Adam Niedzielski Date: Thu, 26 Jan 2017 19:16:50 +0100 Subject: Introduce maximum session time for terminal websocket connection Store the value in application settings. Expose the value to Workhorse. --- db/schema.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 92b36218a15..a9f4e865d60 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -109,6 +109,7 @@ ActiveRecord::Schema.define(version: 20170204181513) do t.boolean "html_emails_enabled", default: true t.string "plantuml_url" t.boolean "plantuml_enabled" + t.integer "terminal_max_session_time", default: 0, null: false end create_table "audit_events", force: :cascade do |t| -- cgit v1.2.1