summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2018-04-19 14:12:42 +0000
committerFilipa Lacerda <filipa@gitlab.com>2018-04-20 10:31:11 +0100
commit8b6e7e01b81405f7a2bdd7bcc35cc8d7c78e3c68 (patch)
tree19f2a8b57a739f7a426f59be21111b0d138e2c0b
parentf65ce40cdeba862aa101360ee1db03adc59d9823 (diff)
downloadgitlab-ce-8b6e7e01b81405f7a2bdd7bcc35cc8d7c78e3c68.tar.gz
Merge branch '45476-geo-statement-timeout-counting-local-job-artifacts' into 'master'
Resolve "Geo: Statement timeout counting local job artifacts" Closes #45476 See merge request gitlab-org/gitlab-ce!18444
-rw-r--r--changelogs/unreleased/45476-geo-statement-timeout-counting-local-job-artifacts.yml5
-rw-r--r--db/migrate/20180418053107_add_index_to_ci_job_artifacts_file_store.rb15
-rw-r--r--db/schema.rb3
3 files changed, 22 insertions, 1 deletions
diff --git a/changelogs/unreleased/45476-geo-statement-timeout-counting-local-job-artifacts.yml b/changelogs/unreleased/45476-geo-statement-timeout-counting-local-job-artifacts.yml
new file mode 100644
index 00000000000..763d3a28200
--- /dev/null
+++ b/changelogs/unreleased/45476-geo-statement-timeout-counting-local-job-artifacts.yml
@@ -0,0 +1,5 @@
+---
+title: Add index to file_store on ci_job_artifacts
+merge_request: 18444
+author:
+type: performance
diff --git a/db/migrate/20180418053107_add_index_to_ci_job_artifacts_file_store.rb b/db/migrate/20180418053107_add_index_to_ci_job_artifacts_file_store.rb
new file mode 100644
index 00000000000..1084ca14a34
--- /dev/null
+++ b/db/migrate/20180418053107_add_index_to_ci_job_artifacts_file_store.rb
@@ -0,0 +1,15 @@
+class AddIndexToCiJobArtifactsFileStore < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :ci_job_artifacts, :file_store
+ end
+
+ def down
+ remove_index :ci_job_artifacts, :file_store if index_exists?(:ci_job_artifacts, :file_store)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index fd75b176318..364166f6c30 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: 20180405142733) do
+ActiveRecord::Schema.define(version: 20180418053107) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -367,6 +367,7 @@ ActiveRecord::Schema.define(version: 20180405142733) do
end
add_index "ci_job_artifacts", ["expire_at", "job_id"], name: "index_ci_job_artifacts_on_expire_at_and_job_id", using: :btree
+ add_index "ci_job_artifacts", ["file_store"], name: "index_ci_job_artifacts_on_file_store", using: :btree
add_index "ci_job_artifacts", ["job_id", "file_type"], name: "index_ci_job_artifacts_on_job_id_and_file_type", unique: true, using: :btree
add_index "ci_job_artifacts", ["project_id"], name: "index_ci_job_artifacts_on_project_id", using: :btree