Skip to content

Replicate integrations.type indices for integrations.type_new

Alex Kalderimis requested to merge 333508-ajk-use-type-new-indices into master

What does this MR do and why?

Part of the effort to move the integrations.type column to integrations.type_new.

This MR adds all the indices we use for integrations.type, replicating them for integrations.type_new, so that when we start using the new column we get identical performance, and when we remove type we don't lose the consistency guarantees.

Migration details

  • Type: Post deploy
  • Duration: 57.7 s
  • Database size change: +319.80 MiB
Query Calls Time
CREATE INDEX CONCURRENTLY "index_integrations_on_project_and_type_new_where_inherit_null" ON "integrations" ("project_id", "type_new") WHERE inherit_from_id IS NULL 1 23322.4 ms
CREATE UNIQUE INDEX CONCURRENTLY "index_integrations_on_project_id_and_type_new_unique" ON "integrations" ("project_id", "type_new") 1 8982.3 ms
CREATE INDEX CONCURRENTLY "index_integrations_on_type_new" ON "integrations" ("type_new") 1 7215.0 ms
CREATE INDEX CONCURRENTLY "index_integrations_on_unique_group_id_and_type_new" ON "integrations" ("group_id", "type_new") 1 6618.8 ms
CREATE INDEX CONCURRENTLY "index_integrations_on_type_new_id_when_active_and_project_id_no" ON "integrations" ("type_new", "id") WHERE ((active = true) AND (project_id IS NOT NULL)) 1 4088.5 ms
CREATE INDEX CONCURRENTLY "index_integrations_on_type_new_and_instance_partial" ON "integrations" ("type_new", "instance") WHERE instance = true 1 812.9 ms
CREATE INDEX CONCURRENTLY "index_integrations_on_type_new_and_template_partial" ON "integrations" ("type_new", "template") WHERE template = true 1 690.8 ms

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

Edited by Alex Kalderimis

Merge request reports

Loading