Drop full index on ci_builds.token
What does this MR do?
This change drops the full index on ci_builds (token)
which has been replaced with a partial index on ci_builds (token) WHERE token IS NOT NULL
instead (see !64221 (merged)).
This index is a flat line in terms of index scans on GitLab.com: https://thanos-query.ops.gitlab.net/graph?g0.range_input=1d&g0.max_source_resolution=0s&g0.expr=sum(rate(pg_stat_user_indexes_idx_scan%7Benv%3D%22gprd%22%2C%20relname%3D%22ci_builds%22%2C%20indexrelname%3D%22index_ci_builds_on_token%22%7D%5B5m%5D))&g0.tab=0
The partial index isn't being used either, but this reflects that non-encrypted tokens are not relevant for GitLab.com anymore.
Relates to #333812 (closed)
Migration log
== 20210629104933 DropIndexOnCiBuildsForToken: reverting ======================
-- transaction_open?()
-> 0.0000s
-- index_exists?(:ci_builds, :token, {:unique=>true, :name=>:index_ci_builds_on_token, :algorithm=>:concurrently})
-> 0.0075s
-- execute("SET statement_timeout TO 0")
-> 0.0004s
-- add_index(:ci_builds, :token, {:unique=>true, :name=>:index_ci_builds_on_token, :algorithm=>:concurrently})
-> 0.0156s
-- execute("RESET ALL")
-> 0.0006s
== 20210629104933 DropIndexOnCiBuildsForToken: reverted (0.0249s) =============
== 20210629104933 DropIndexOnCiBuildsForToken: migrating ======================
-- transaction_open?()
-> 0.0000s
-- indexes(:ci_builds)
-> 0.0080s
-- execute("SET statement_timeout TO 0")
-> 0.0005s
-- remove_index(:ci_builds, {:algorithm=>:concurrently, :name=>:index_ci_builds_on_token})
-> 0.0091s
-- execute("RESET ALL")
-> 0.0006s
== 20210629104933 DropIndexOnCiBuildsForToken: migrated (0.0188s) =============
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Edited by Andreas Brandl