Skip to content

Remove redundant index_releases_on_author_id

What does this MR do and why?

We recently added index on (author_id, id, created_at), so index on (author_id) is redundant now.

Migration logs

vlad @ gdk1 ➜  gitlab git:(342385-remove-redundant-index_releases_on_author_id) ✗  ./bin/rails db:migrate                                                                                                                                     
== 20211026143238 RemoveIndexReleasesOnAuthorId: migrating ====================
-- transaction_open?()
   -> 0.0000s
-- indexes(:releases)
   -> 0.0110s
-- execute("SET statement_timeout TO 0")
   -> 0.0011s
-- remove_index(:releases, {:algorithm=>:concurrently, :name=>"index_releases_on_author_id"})
   -> 0.0076s
-- execute("RESET statement_timeout")
   -> 0.0012s
== 20211026143238 RemoveIndexReleasesOnAuthorId: migrated (0.0386s) ===========

vlad @ gdk1 ➜  gitlab git:(342385-remove-redundant-index_releases_on_author_id) ✗  ./bin/rails db:rollback
== 20211026143238 RemoveIndexReleasesOnAuthorId: reverting ====================
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:releases, [:author_id], {:name=>"index_releases_on_author_id", :algorithm=>:concurrently})
   -> 0.0065s
-- execute("SET statement_timeout TO 0")
   -> 0.0014s
-- add_index(:releases, [:author_id], {:name=>"index_releases_on_author_id", :algorithm=>:concurrently})
   -> 0.0081s
-- execute("RESET statement_timeout")
   -> 0.0016s
== 20211026143238 RemoveIndexReleasesOnAuthorId: reverted (0.0230s) ===========

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 #342385 (closed)

Edited by Vladimir Shushlin

Merge request reports

Loading