Add index on License Compliance artifacts
What does this MR do?
We're adding this index to speed up the migration where we migrating license_management
artifacts to be license_scanning
.
We'll remove this index once #213571 (closed) is addressed (#233387 (closed))
Migration
up
== 20200803130111 AddIndexForLicenseComplianceArtifacts: migrating ============
-- transaction_open?()
-> 0.0000s
-- index_exists?(:ci_job_artifacts, :file_type, {:where=>"file_type IN (10, 101)", :name=>"index_ci_job_artifacts_on_license_compliance_file_types", :algorithm=>:concurrently})
-> 0.0055s
-- add_index(:ci_job_artifacts, :file_type, {:where=>"file_type IN (10, 101)", :name=>"index_ci_job_artifacts_on_license_compliance_file_types", :algorithm=>:concurrently})
-> 0.0105s
== 20200803130111 AddIndexForLicenseComplianceArtifacts: migrated (0.0166s) ===
down
== 20200803130111 AddIndexForLicenseComplianceArtifacts: reverting ============
-- transaction_open?()
-> 0.0000s
-- indexes(:ci_job_artifacts)
-> 0.0049s
-- remove_index(:ci_job_artifacts, {:algorithm=>:concurrently, :name=>"index_ci_job_artifacts_on_license_compliance_file_types"})
-> 0.0042s
== 20200803130111 AddIndexForLicenseComplianceArtifacts: reverted (0.0096s) ===
Execution (from #database-lab)
exec create index CONCURRENTLY lm_artifacts ON public.ci_job_artifacts USING btree (job_id, id) WHERE "ci_job_artifacts"."file_type" IN (10, 101)
The query has been executed. Duration: 70.807 min
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
- [-] Code review guidelines
-
Merge request performance guidelines - [-] Style guides
-
Database guides - [-] Separation of EE specific content
Availability and Testing
- [-] Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
- [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Tetiana Chupryna