Skip to content

Add extended open issues index

What does this MR do and why?

It adds new index which was already added async here.

Now we need to add it to structure.sql as async index creation guide suggests.

Migration output

main: == 20220825142324 ReplaceIssuesAuthorizationIndex: reverting ==================
main: -- transaction_open?()
main:    -> 0.0000s
main: -- index_exists?(:issues, [:project_id, :confidential], {:name=>"idx_open_issues_on_project_id_and_confidential", :where=>"state_id = 1", :algorithm=>:concurrently})
main:    -> 0.0191s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0003s
main: -- add_index(:issues, [:project_id, :confidential], {:name=>"idx_open_issues_on_project_id_and_confidential", :where=>"state_id = 1", :algorithm=>:concurrently})
main:    -> 0.0035s
main: -- execute("RESET statement_timeout")
main:    -> 0.0003s
main: -- transaction_open?()
main:    -> 0.0000s
main: -- indexes(:issues)
main:    -> 0.0121s
main: -- remove_index(:issues, {:algorithm=>:concurrently, :name=>"idx_open_issues_on_project_and_confidential_and_author_and_id"})
main:    -> 0.0022s
main: == 20220825142324 ReplaceIssuesAuthorizationIndex: reverted (0.0464s) =========

main: == 20220825142324 ReplaceIssuesAuthorizationIndex: migrating ==================
main: -- transaction_open?()
main:    -> 0.0000s
main: -- index_exists?(:issues, [:project_id, :confidential, :author_id, :id], {:name=>"idx_open_issues_on_project_and_confidential_and_author_and_id", :where=>"state_id = 1", :algorithm=>:concurrently})
main:    -> 0.0146s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0002s
main: -- add_index(:issues, [:project_id, :confidential, :author_id, :id], {:name=>"idx_open_issues_on_project_and_confidential_and_author_and_id", :where=>"state_id = 1", :algorithm=>:concurrently})
main:    -> 0.0025s
main: -- execute("RESET statement_timeout")
main:    -> 0.0002s
main: -- transaction_open?()
main:    -> 0.0000s
main: -- indexes(:issues)
main:    -> 0.0125s
main: -- remove_index(:issues, {:algorithm=>:concurrently, :name=>"idx_open_issues_on_project_id_and_confidential"})
main:    -> 0.0016s
main: == 20220825142324 ReplaceIssuesAuthorizationIndex: migrated (0.0362s) =========

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

Edited by Pavel Shutsin

Merge request reports