Skip to content

Remove redundant index_epic_issues_on_epic_id

Tiger Watson requested to merge remove-redundant-epic-issues-index into master

What does this MR do and why?

We have the following two indexes on epic_issues; the former is made redundant by the latter:

CREATE INDEX index_epic_issues_on_epic_id ON epic_issues USING btree (epic_id);

CREATE INDEX index_epic_issues_on_epic_id_and_issue_id ON epic_issues USING btree (epic_id, issue_id);

Migration output

== 20220204053655 RemoveIndexEpicIssuesOnEpicId: migrating ====================
-- transaction_open?()
   -> 0.0000s
-- indexes(:epic_issues)
   -> 0.0061s
-- execute("SET statement_timeout TO 0")
   -> 0.0008s
-- remove_index(:epic_issues, {:algorithm=>:concurrently, :name=>"index_epic_issues_on_epic_id"})
   -> 0.0045s
-- execute("RESET statement_timeout")
   -> 0.0006s
== 20220204053655 RemoveIndexEpicIssuesOnEpicId: migrated (0.0142s) ===========
== 20220204053655 RemoveIndexEpicIssuesOnEpicId: reverting ====================
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:epic_issues, :epic_id, {:name=>"index_epic_issues_on_epic_id", :algorithm=>:concurrently})
   -> 0.0040s
-- execute("SET statement_timeout TO 0")
   -> 0.0006s
-- add_index(:epic_issues, :epic_id, {:name=>"index_epic_issues_on_epic_id", :algorithm=>:concurrently})
   -> 0.0064s
-- execute("RESET statement_timeout")
   -> 0.0010s
== 20220204053655 RemoveIndexEpicIssuesOnEpicId: reverted (0.0150s) ===========

How to set up and validate locally

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

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 Mayra Cabrera

Merge request reports

Loading