Add migration helper index for Vulnerabilities::Finding table
What does this MR do?
This MR creates and index backing the migration process outlined in #224457 (closed). Closes #234065 (closed).
rails db:migrate
== 20200807110237 AddMigrationIndexToVulnerabilitiesOccurrences: migrating ====
-- execute("CREATE INDEX CONCURRENTLY issue_links_migration_idx ON vulnerability_occurrences (project_id, report_type, encode(project_fingerprint, 'hex'::text));\n")
-> 0.0097s
== 20200807110237 AddMigrationIndexToVulnerabilitiesOccurrences: migrated (0.0098s)
rails db:rollback
== 20200807110237 AddMigrationIndexToVulnerabilitiesOccurrences: reverting ====
-- execute("DROP INDEX CONCURRENTLY issue_links_migration_idx;\n")
-> 0.0773s
== 20200807110237 AddMigrationIndexToVulnerabilitiesOccurrences: reverted (0.0774s)
database-lab results
Index creation
CREATE INDEX CONCURRENTLY issue_links_migration_idx ON vulnerability_occurrences (project_id, report_type, encode(project_fingerprint, 'hex'::text));
The query has been executed. Duration: 1.709 min
Index size
\di+ issue_links_migration_idx
List of relations
Schema | Name | Type | Owner | Table | Size | Description
--------+---------------------------+-------+--------+---------------------------+--------+-------------
public | issue_links_migration_idx | index | gitlab | vulnerability_occurrences | 258 MB |
(1 row)
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 Michał Zając