Skip to content

Drop unused ci builds index

Max Orefice requested to merge morefice/drop-unused-ci-builds-index into master

Ref: #271620 (closed)

What does this MR do and why?

This MR drops our index_ci_builds_on_user_id_and_created_at_and_type_eq_ci_build which does not seem to be used according to Thanos.

Screenshots or screen recordings

Screenshot_2022-06-29_at_11.49.33

Database

Migrations output:

main: == 20220629093102 DropUserCreatedAtFromCiBuilds: migrating ====================
main: -- transaction_open?()
main:    -> 0.0000s
main: -- indexes(:ci_builds)
main:    -> 0.0082s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0001s
main: -- remove_index(:ci_builds, {:algorithm=>:concurrently, :name=>"index_ci_builds_on_user_id_and_created_at_and_type_eq_ci_build"})
main:    -> 0.0034s
main: -- execute("RESET statement_timeout")
main:    -> 0.0001s
main: == 20220629093102 DropUserCreatedAtFromCiBuilds: migrated (0.0175s) ===========

ci: == 20220629093102 DropUserCreatedAtFromCiBuilds: migrating ====================
ci: -- transaction_open?()
ci:    -> 0.0000s
ci: -- indexes(:ci_builds)
ci:    -> 0.0070s
ci: -- execute("SET statement_timeout TO 0")
ci:    -> 0.0001s
ci: -- remove_index(:ci_builds, {:algorithm=>:concurrently, :name=>"index_ci_builds_on_user_id_and_created_at_and_type_eq_ci_build"})
ci:    -> 0.0029s
ci: -- execute("RESET statement_timeout")
ci:    -> 0.0001s
ci: == 20220629093102 DropUserCreatedAtFromCiBuilds: migrated (0.0124s) ===========


--------------------------------------------

main: == 20220629093102 DropUserCreatedAtFromCiBuilds: reverting ====================
main: -- transaction_open?()
main:    -> 0.0000s
main: -- index_exists?(:ci_builds, [:user_id, :created_at], {:where=>"((type)::text = 'Ci::Build'::text)", :name=>"index_ci_builds_on_user_id_and_created_at_and_type_eq_ci_build", :algorithm=>:concurrently})
main:    -> 0.0092s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0001s
main: -- add_index(:ci_builds, [:user_id, :created_at], {:where=>"((type)::text = 'Ci::Build'::text)", :name=>"index_ci_builds_on_user_id_and_created_at_and_type_eq_ci_build", :algorithm=>:concurrently})
main:    -> 0.0045s
main: -- execute("RESET statement_timeout")
main:    -> 0.0002s
main: == 20220629093102 DropUserCreatedAtFromCiBuilds: reverted (0.0183s) ===========


ci: == 20220629093102 DropUserCreatedAtFromCiBuilds: reverting ====================
ci: -- transaction_open?()
ci:    -> 0.0000s
ci: -- index_exists?(:ci_builds, [:user_id, :created_at], {:where=>"((type)::text = 'Ci::Build'::text)", :name=>"index_ci_builds_on_user_id_and_created_at_and_type_eq_ci_build", :algorithm=>:concurrently})
ci:    -> 0.0090s
ci: -- execute("SET statement_timeout TO 0")
ci:    -> 0.0002s
ci: -- add_index(:ci_builds, [:user_id, :created_at], {:where=>"((type)::text = 'Ci::Build'::text)", :name=>"index_ci_builds_on_user_id_and_created_at_and_type_eq_ci_build", :algorithm=>:concurrently})
ci:    -> 0.0054s
ci: -- execute("RESET statement_timeout")
ci:    -> 0.0002s
ci: == 20220629093102 DropUserCreatedAtFromCiBuilds: reverted (0.0189s) ===========

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 Max Orefice

Merge request reports

Loading