Skip to content

Remove redundant index on clusters_kubernetes_namespaces

Tiger Watson requested to merge remove-redundant-k8s-namespaces-index into master

What does this MR do and why?

Removes a redundant index on clusters_kubernetes_namespaces (cluster_id) as there is also an index on (cluster_id, project_id, environment_id).

Migrations output

== 20220201034731 RemoveIndexClustersKubernetesNamespacesOnClusterId: migrating
-- transaction_open?()
   -> 0.0000s
-- indexes(:clusters_kubernetes_namespaces)
   -> 0.0210s
-- execute("SET statement_timeout TO 0")
   -> 0.0015s
-- remove_index(:clusters_kubernetes_namespaces, {:algorithm=>:concurrently, :name=>"index_clusters_kubernetes_namespaces_on_cluster_id"})
   -> 0.0066s
-- execute("RESET statement_timeout")
   -> 0.0009s
== 20220201034731 RemoveIndexClustersKubernetesNamespacesOnClusterId: migrated (0.0335s)
== 20220201034731 RemoveIndexClustersKubernetesNamespacesOnClusterId: reverting
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:clusters_kubernetes_namespaces, :cluster_id, {:name=>"index_clusters_kubernetes_namespaces_on_cluster_id", :algorithm=>:concurrently})
   -> 0.0090s
-- execute("SET statement_timeout TO 0")
   -> 0.0012s
-- add_index(:clusters_kubernetes_namespaces, :cluster_id, {:name=>"index_clusters_kubernetes_namespaces_on_cluster_id", :algorithm=>:concurrently})
   -> 0.0121s
-- execute("RESET statement_timeout")
   -> 0.0011s
== 20220201034731 RemoveIndexClustersKubernetesNamespacesOnClusterId: reverted (0.0302s)

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 Tiger Watson

Merge request reports