diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-22 06:09:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-22 06:09:19 +0300 |
commit | 37a0fef392fb9da809a6b8aea0115740a5c2ceb6 (patch) | |
tree | df4cef63a1fcd5bab5c9fa0174b2cd3d398325ad /db | |
parent | e3e139096eee0cce110d56744aa9431c8f801278 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20200218113721_add_indexes_to_package_file.rb | 19 | ||||
-rw-r--r-- | db/structure.sql | 5 |
2 files changed, 24 insertions, 0 deletions
diff --git a/db/migrate/20200218113721_add_indexes_to_package_file.rb b/db/migrate/20200218113721_add_indexes_to_package_file.rb new file mode 100644 index 00000000000..7c66da6819e --- /dev/null +++ b/db/migrate/20200218113721_add_indexes_to_package_file.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddIndexesToPackageFile < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :packages_package_files, :verification_failure, where: "(verification_failure IS NOT NULL)", name: "packages_packages_verification_failure_partial" + add_concurrent_index :packages_package_files, :verification_checksum, where: "(verification_checksum IS NOT NULL)", name: "packages_packages_verification_checksum_partial" + end + + def down + remove_concurrent_index :packages_package_files, :verification_failure + remove_concurrent_index :packages_package_files, :verification_checksum + end +end diff --git a/db/structure.sql b/db/structure.sql index fb222a570a2..f41d9c7d542 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -10544,6 +10544,10 @@ CREATE INDEX note_mentions_temp_index ON public.notes USING btree (id, noteable_ CREATE UNIQUE INDEX one_canonical_wiki_page_slug_per_metadata ON public.wiki_page_slugs USING btree (wiki_page_meta_id) WHERE (canonical = true); +CREATE INDEX packages_packages_verification_checksum_partial ON public.packages_package_files USING btree (verification_checksum) WHERE (verification_checksum IS NOT NULL); + +CREATE INDEX packages_packages_verification_failure_partial ON public.packages_package_files USING btree (verification_failure) WHERE (verification_failure IS NOT NULL); + CREATE INDEX partial_index_ci_builds_on_scheduled_at_with_scheduled_jobs ON public.ci_builds USING btree (scheduled_at) WHERE ((scheduled_at IS NOT NULL) AND ((type)::text = 'Ci::Build'::text) AND ((status)::text = 'scheduled'::text)); CREATE INDEX partial_index_deployments_for_legacy_successful_deployments ON public.deployments USING btree (id) WHERE ((finished_at IS NULL) AND (status = 2)); @@ -13065,6 +13069,7 @@ COPY "schema_migrations" (version) FROM STDIN; 20200217210353 20200217223651 20200217225719 +20200218113721 20200219105209 20200219133859 20200219135440 |