Remove existing records from the security_findings table
What does this MR do?
This MR introduces a background migration to truncate the security_findings
table.
Table size
73_121_396 rows and keeps growing!
EXPLAIN ANALYZE SELECT id FROM security_findings;
Index Only Scan using security_findings_pkey on public.security_findings (cost=0.57..1727189.92 rows=73026656 width=8) (actual time=6.723..195863.377 rows=73121396 loops=1)
Heap Fetches: 663622
Buffers: shared hit=1169050 read=428068 dirtied=9466 written=1
I/O Timings: read=180905.379 write=0.138
rake db:migrate:up
== 20201102152945 TruncateSecurityFindingsTable: migrating ====================
== 20201102152945 TruncateSecurityFindingsTable: migrated (0.0144s) ===========
rake db:migrate:down
== 20201102152945 TruncateSecurityFindingsTable: reverting ====================
== 20201102152945 TruncateSecurityFindingsTable: reverted (0.0000s) ===========
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 Mehmet Emin INAC