Skip to content

Remove index_deployments_on_project_id_sha asynchronously

What does this MR do and why?

This is part of an epic to optimize the deployments table by removing unused indexes: &10185

This MR is an asynchronous removal migration for index_deployments_on_project_id_sha. The sync index removal will be done in a follow-up MR.

The definition of this index is:

"index_deployments_on_project_id_sha" btree (project_id, sha)

Index usage rate

As of 5 July 2023, the usage rate for the past 30 is days 0, while the usage rate for the past 60 days is 0.000053240809572017204. I can't find anything in the DeploymentsFinder, DeploymentsResolver, or DeploymentResolver that uses sha, so I think this is safe to drop.

Issue: #402512 (closed)

Screenshots or screen recordings

Migration output

main: == [advisory_lock_connection] object_id: 223460, pg_backend_pid: 86023
main: == 20230704042302 PrepareRemovalIndexDeploymentsOnProjectIdSha: migrating =====
main: -- index_exists?(:deployments, [:project_id, :sha], {:name=>"index_deployments_on_project_id_sha"})
main:    -> 0.0921s
main: -- quote_column_name("index_deployments_on_project_id_sha")
main:    -> 0.0000s
main: == 20230704042302 PrepareRemovalIndexDeploymentsOnProjectIdSha: migrated (0.1074s) 

How to set up and validate locally

N/A

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #402512 (closed)

Edited by Pam Artiaga

Merge request reports