Skip to content

Removes temporary index on project_statistics

Vijay Hawoldar requested to merge vij-remove-tmp-index into master

What does this MR do and why?

Removes temporary index on project_statistics that was added in 031e79cb.

We previously added the temporary index on the updated_at column to support a background migration to backfill data.

The backfill completed in October '23, so we can now remove this index.

This will also assist with https://gitlab.com/gitlab-com/gitlab-OKRs/-/work_items/7861#note_1917578083

Refs #467342 (closed)

migrate up
 bin/rails db:migrate
main: == [advisory_lock_connection] object_id: 125720, pg_backend_pid: 83724
main: == 20240530114822 RemoveTmpIndexProjectStatisticsUpdatedAt: migrating =========
main: -- index_exists?(:project_statistics, [:project_id, :updated_at], {:name=>"tmp_index_project_statistics_updated_at"})
main:    -> 0.0326s
main: == 20240530114822 RemoveTmpIndexProjectStatisticsUpdatedAt: migrated (0.0472s) 

main: == [advisory_lock_connection] object_id: 125720, pg_backend_pid: 83724
migrate down
 bin/rails db:migrate:down:main VERSION=20240530114822
main: == [advisory_lock_connection] object_id: 125420, pg_backend_pid: 84236
main: == 20240530114822 RemoveTmpIndexProjectStatisticsUpdatedAt: reverting =========
main: == 20240530114822 RemoveTmpIndexProjectStatisticsUpdatedAt: reverted (0.0250s) 

main: == [advisory_lock_connection] object_id: 125420, pg_backend_pid: 84236

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Vijay Hawoldar

Merge request reports