Schedule external_key index removal

What does this MR do and why?

Schedule external_key index removal

Schedules the removal of the external_key index on the issues table.

Changelog: removed

References

Index usage: https://dashboards.gitlab.net/goto/Nv0CULwNg?orgId=1

Screenshots or screen recordings

Screenshot_2025-08-04_at_10.27.25

Before After

How to set up and validate locally

 bin/rails db:migrate
main: == [advisory_lock_connection] object_id: 144600, pg_backend_pid: 71399
main: == 20250801143759 RemoveIndexIssuesOnProjectIdAndExternalKey: migrating =======
main: -- index_exists?(:issues, [:project_id, :external_key], {:name=>"index_issues_on_project_id_and_external_key"})
main:    -> 0.0224s
main: -- quote_column_name("index_issues_on_project_id_and_external_key")
main:    -> 0.0000s
main: == 20250801143759 RemoveIndexIssuesOnProjectIdAndExternalKey: migrated (0.0524s)

main: == [advisory_lock_connection] object_id: 144600, pg_backend_pid: 71399
select * from postgres_async_indexes order by id desc limit 1;
 id |          created_at           |          updated_at           |                    name                     |                              definition                               | table_name | attempts | last_error
----+-------------------------------+-------------------------------+---------------------------------------------+-----------------------------------------------------------------------+------------+----------+------------
 38 | 2025-08-01 15:08:12.570166+00 | 2025-08-01 15:08:12.570166+00 | index_issues_on_project_id_and_external_key | DROP INDEX CONCURRENTLY "index_issues_on_project_id_and_external_key" | issues     |        0 |
(1 row)

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.

Edited by Nicolas Dular

Merge request reports

Loading