Add index on vulnerability_finding_links with NULLS NOT DISTINCT
What does this MR do and why?
Add index on vulnerability_finding_links with NULLS NOT DISTINCT.
The intent here is to replace finding_link_name_url_idx and finding_link_url_idx indexes, see !229316 (comment 3203796001)+ for rationale.
Old indices will not be dropped until this index is created so that we do not accidentally create rows which would violate uniqueness on name IS NULL.
This will save us a few hundred gigabytes:
List of relations
Schema | Name | Type | Owner | Table | Persistence | Access method | Size | Description
--------+---------------------------+-------+---------------------------+-----------------------------+-------------+---------------+--------+-------------
public | finding_link_name_url_idx | index | joe_mzajac_gitlab_com_187 | vulnerability_finding_links | permanent | btree | 225 GB |
public | finding_link_url_idx | index | joe_mzajac_gitlab_com_187 | vulnerability_finding_links | permanent | btree | 204 GB | References
Related discussion: !229316 (comment 3203796001)
Schema change request which discovered the overlap: https://gitlab.com/gitlab-org/database-team/team-tasks/-/work_items/594
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.