Skip to content

Async removal of partial_index_deployments_for_project_id_and_tag

What does this MR do and why?

Optimise deployments table by removing an unused index

This is an asynchronous removal migration for index partial_index_deployments_for_project_id_and_tag. The follow-up remove_concurrent_index MR is !119271 (merged) - this will be merged later.

The index has been unused for at least 8 weeks according to Thanos.

Index definition on deployments table:

    "partial_index_deployments_for_project_id_and_tag" btree (project_id) WHERE tag IS TRUE

This change is part of a bigger epic aiming to optimise the deployments table: &10185

Issue: #402516 (closed)

Migration output

main: == 20230501094322 PrepareRemovalPartialIndexDeploymentsForProjectIdAndTag: migrating
main: -- index_exists?(:deployments, :project_id, {:name=>"partial_index_deployments_for_project_id_and_tag"})
main:    -> 0.0894s
main: -- quote_column_name("partial_index_deployments_for_project_id_and_tag")
main:    -> 0.0000s
main: == 20230501094322 PrepareRemovalPartialIndexDeploymentsForProjectIdAndTag: migrated (0.1043s)

main: == 20230501094322 PrepareRemovalPartialIndexDeploymentsForProjectIdAndTag: reverting
main: == 20230501094322 PrepareRemovalPartialIndexDeploymentsForProjectIdAndTag: reverted (0.1157s)

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.

Edited by Tiger Watson

Merge request reports