Skip to content

Add pre-requisite code needed for backfilling project namespaces migration

Alexandru Croitor requested to merge 337100_backfill_project_namespaces into master

What does this MR do and why?

This adds code and migration pre-requisites necessary to run project namespace backfill migration.

  • Adds a tmp_project_id column to namespaces table to track project_id for the newly created project namespaces to link to the project. We need the column so that we can do raw batch inserts and not have to use active record.
  • Adds FK and index for the tmp_project_id column.
  • Adds BackfillProjectNamespaces background migration worker
  • Isolates namespace and project models as well as related hierarchy traversal code out of the main codebase.

Code breakdown

  • db/migrate/20211018101034_add_tmp_project_id_column_to_namespaces.rb - adds temporary column
  • db/migrate/20211018101852_add_fk_to_tmp_project_id_column_on_namespaces_table.rb - adds FK for the temporary column
  • db/migrate/20211018102152_add_index_to_tmp_project_id_column_on_namespaces_table.rb - adds unique index on the temporary column. This unique index is used to rely on not adding duplicate records in case we need to re-run a migration for the same set of projects.
  • lib/gitlab/background_migration/project_namespaces/models - code isolation. All of the code needed to run the migration in isolation and not rely on code changes in the codebase.
  • lib/gitlab/background_migration/project_namespaces/backfill_project_namespaces.rb - actual background migration worker.

Database

Here are the log files for running the migration on gitlab-org group both up and down versions. Note that logs are from pg.ai instance so these are not production times.

I'll extract one query for each case and post query plans here:

Up

Schema migrations

== 20211018101034 AddTmpProjectIdColumnToNamespaces: migrating ================
-- add_column(:namespaces, :tmp_project_id, :integer)
   -> 0.0022s
== 20211018101034 AddTmpProjectIdColumnToNamespaces: migrated (0.0023s) =======
== 20211018101852 AddFkToTmpProjectIdColumnOnNamespacesTable: migrating =======
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:namespaces)
-> 0.0046s
-- transaction_open?()
-> 0.0000s
-- execute("ALTER TABLE namespaces\nADD CONSTRAINT fk_6a77f66919\nFOREIGN KEY (tmp_project_id)\nREFERENCES projects (id)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0073s
-- execute("SET statement_timeout TO 0")
-> 0.0006s
-- execute("ALTER TABLE namespaces VALIDATE CONSTRAINT fk_6a77f66919;")
-> 0.0456s
-- execute("RESET statement_timeout")
-> 0.0008s
== 20211018101852 AddFkToTmpProjectIdColumnOnNamespacesTable: migrated (0.0643s)
== 20211018102152 AddIndexToTmpProjectIdColumnOnNamespacesTable: migrating ====
-- transaction_open?()
-> 0.0000s
-- index_exists?(:namespaces, :tmp_project_id, {:name=>"tmp_index_on_tmp_project_id_on_namespaces", :unique=>true, :algorithm=>:concurrently})
-> 0.0136s
-- add_index(:namespaces, :tmp_project_id, {:name=>"tmp_index_on_tmp_project_id_on_namespaces", :unique=>true, :algorithm=>:concurrently})
-> 0.0075s
== 20211018102152 AddIndexToTmpProjectIdColumnOnNamespacesTable: migrated (0.0239s)
== 20211018102252 AddIndexToGroupIdColumnOnWebhooksTable: migrating ===========
-- transaction_open?()
-> 0.0000s
-- index_exists?(:web_hooks, :group_id, {:name=>"index_on_group_id_on_webhooks", :algorithm=>:concurrently})
-> 0.0036s
-- add_index(:web_hooks, :group_id, {:name=>"index_on_group_id_on_webhooks", :algorithm=>:concurrently})
-> 0.0042s
== 20211018102252 AddIndexToGroupIdColumnOnWebhooksTable: migrated (0.0101s) ==
Ruby snippet to run up migration

migration = Gitlab::BackgroundMigration::ProjectNamespaces::BackfillProjectNamespaces.new
migration.perform(13083, 31051707, 9970, 'up')
Insert project namespaces

explain analyze 
INSERT INTO namespaces (tmp_project_id, name, path, parent_id, visibility_level, type, created_at, updated_at)
SELECT projects.id, projects.name, projects.path, projects.namespace_id, projects.visibility_level, 'Project', now(), now() 
FROM "projects" 
WHERE "projects"."id" IN (
    19568296, 19655424, 19993243, 20081132, 20630561, 20839085, 21649753, 22847718, 23512541, 23526204, 25969582, 
    27668507, 27918529, 28599337, 28921571, 25037358, 25336653, 20802859, 20466430, 21324924, 21628863, 23544263, 
    21525059, 23495190, 23921884, 23924111, 23949254, 26543618, 27792539, 28933533, 27051800, 27286937, 27650153, 
    27038823, 27040581, 27831771, 27945995, 28555583, 30268311, 30404214, 30404592, 30404693, 30404805, 30404858, 
    30820359, 30824708, 19209142, 19245461, 17050975, 17151529, 17410444, 17661947, 18877555, 21607123, 25162318, 
    25443214, 25495696, 22111360, 24298348, 27069846, 24055623, 24059189, 24007929, 24112267, 24124293, 24127174, 
    25843190, 27605238, 28955943, 29796603, 29796683, 29796712, 22955441, 18256369, 24964122, 24964171, 27424635, 
    18855948, 18943563, 17584993, 24470059, 26903700, 26903728, 17022380, 17031626, 17271570, 18021647, 20190582, 
    20662496, 20921195, 21949381, 26434779, 26435679, 18855526, 14158369, 21138460, 25375648, 23457285, 24434775, 
    16816732
)
ON CONFLICT DO NOTHING;
                                        QUERY PLAN
---------------------------------------------------------------------------------------------------------
 Insert on namespaces  (cost=0.44..323.28 rows=100 width=1969) (actual time=68.967..68.968 rows=0 loops=1)
   Conflict Resolution: NOTHING
   Tuples Inserted: 100
   Conflicting Tuples: 0
   ->  Index Scan using projects_pkey on projects  (cost=0.44..323.28 rows=100 width=1969) (actual time=0.185..2.809 rows=100 loops=1)
         Index Cond: (id = ANY ('{19568296,19655424,19993243,20081132,20630561,20839085,21649753,22847718,23512541,23526204,25969582,27668507,27918529,28599337,28921571,25037358,25336653,20802859,20466430,21324924,21628863,23544263,21525059,23495190,23921884,23924111,23949254,26543618,27792539,28933533,27051800,27286937,27650153,27038823,27040581,27831771,27945995,28555583,30268311,30404214,30404592,30404693,30404805,30404858,30820359,30824708,19209142,19245461,17050975,17151529,17410444,17661947,18877555,21607123,25162318,25443214,25495696,22111360,24298348,27069846,24055623,24059189,24007929,24112267,24124293,24127174,25843190,27605238,28955943,29796603,29796683,29796712,22955441,18256369,24964122,24964171,27424635,18855948,18943563,17584993,24470059,26903700,26903728,17022380,17031626,17271570,18021647,20190582,20662496,20921195,21949381,26434779,26435679,18855526,14158369,21138460,25375648,23457285,24434775,16816732}'::integer[]))
 Planning Time: 4.159 ms
 Trigger for constraint fk_6a77f66919: time=4.302 calls=100
 Trigger for constraint fk_319256d87a: time=0.160 calls=100
 Trigger for constraint fk_3448c97865: time=0.277 calls=100
 Trigger for constraint fk_e7a0b20a6b: time=0.153 calls=100
 Execution Time: 74.977 ms
(12 rows)
Update project's project_namespace_id

explain analyze 
WITH cte(project_namespace_id, project_id) AS MATERIALIZED (
    SELECT namespaces.id, namespaces.tmp_project_id FROM "projects" 
    INNER JOIN namespaces ON projects.id = namespaces.tmp_project_id 
    WHERE "projects"."id" IN (
        19568296, 19655424, 19993243, 20081132, 20630561, 20839085, 21649753, 22847718, 23512541, 23526204, 25969582, 
        27668507, 27918529, 28599337, 28921571, 25037358, 25336653, 20802859, 20466430, 21324924, 21628863, 23544263, 
        21525059, 23495190, 23921884, 23924111, 23949254, 26543618, 27792539, 28933533, 27051800, 27286937, 27650153, 
        27038823, 27040581, 27831771, 27945995, 28555583, 30268311, 30404214, 30404592, 30404693, 30404805, 30404858, 
        30820359, 30824708, 19209142, 19245461, 17050975, 17151529, 17410444, 17661947, 18877555, 21607123, 25162318, 
        25443214, 25495696, 22111360, 24298348, 27069846, 24055623, 24059189, 24007929, 24112267, 24124293, 24127174, 
        25843190, 27605238, 28955943, 29796603, 29796683, 29796712, 22955441, 18256369, 24964122, 24964171, 27424635, 
        18855948, 18943563, 17584993, 24470059, 26903700, 26903728, 17022380, 17031626, 17271570, 18021647, 20190582, 
        20662496, 20921195, 21949381, 26434779, 26435679, 18855526, 14158369, 21138460, 25375648, 23457285, 24434775, 
        16816732
    )
)
UPDATE projects
SET project_namespace_id = cte.project_namespace_id
FROM cte
WHERE id = cte.project_id AND projects.project_namespace_id IS DISTINCT FROM cte.project_namespace_id;
                                                 QUERY PLAN
------------------------------------------------------------------------------------------------------
 Update on projects  (cost=543.93..745.91 rows=58 width=851) (actual time=87.644..87.647 rows=0 loops=1)
   CTE cte
     ->  Nested Loop  (cost=0.87..543.49 rows=58 width=8) (actual time=0.132..2.005 rows=100 loops=1)
           ->  Index Only Scan using projects_pkey on projects projects_1  (cost=0.44..198.24 rows=100 width=4) (actual time=0.095..1.072 rows=100 loops=1)
                 Index Cond: (id = ANY ('{19568296,19655424,19993243,20081132,20630561,20839085,21649753,22847718,23512541,23526204,25969582,27668507,27918529,28599337,28921571,25037358,25336653,20802859,20466430,21324924,21628863,23544263,21525059,23495190,23921884,23924111,23949254,26543618,27792539,28933533,27051800,27286937,27650153,27038823,27040581,27831771,27945995,28555583,30268311,30404214,30404592,30404693,30404805,30404858,30820359,30824708,19209142,19245461,17050975,17151529,17410444,17661947,18877555,21607123,25162318,25443214,25495696,22111360,24298348,27069846,24055623,24059189,24007929,24112267,24124293,24127174,25843190,27605238,28955943,29796603,29796683,29796712,22955441,18256369,24964122,24964171,27424635,18855948,18943563,17584993,24470059,26903700,26903728,17022380,17031626,17271570,18021647,20190582,20662496,20921195,21949381,26434779,26435679,18855526,14158369,21138460,25375648,23457285,24434775,16816732}'::integer[]))
                 Heap Fetches: 100
           ->  Index Scan using tmp_index_on_tmp_project_id_on_namespaces on namespaces  (cost=0.43..3.45 rows=1 width=8) (actual time=0.007..0.007 rows=1 loops=100)
                 Index Cond: (tmp_project_id = projects_1.id)
   ->  Nested Loop  (cost=0.44..202.42 rows=58 width=851) (actual time=0.172..2.887 rows=100 loops=1)
         ->  CTE Scan on cte  (cost=0.00..1.16 rows=58 width=40) (actual time=0.150..2.244 rows=100 loops=1)
         ->  Index Scan using projects_pkey on projects  (cost=0.44..3.46 rows=1 width=771) (actual time=0.004..0.004 rows=1 loops=100)
               Index Cond: (id = cte.project_id)
               Filter: (project_namespace_id IS DISTINCT FROM cte.project_namespace_id)
 Planning Time: 4.024 ms
 Trigger for constraint fk_71625606ac: time=2.906 calls=100
 Execution Time: 91.113 ms
(16 rows)
Update project_namespace's traversal_ids

explain analyze 
UPDATE namespaces
SET traversal_ids = array_append(cte.traversal_ids, cte.project_namespace_id)
FROM (
    SELECT namespaces.id as project_namespace_id, n2.traversal_ids FROM "namespaces" 
    INNER JOIN namespaces n2 ON namespaces.parent_id = n2.id 
    WHERE "namespaces"."tmp_project_id" IN (
        19568296, 19655424, 19993243, 20081132, 20630561, 20839085, 21649753, 22847718, 23512541, 23526204, 25969582, 
        27668507, 27918529, 28599337, 28921571, 25037358, 25336653, 20802859, 20466430, 21324924, 21628863, 23544263, 
        21525059, 23495190, 23921884, 23924111, 23949254, 26543618, 27792539, 28933533, 27051800, 27286937, 27650153, 
        27038823, 27040581, 27831771, 27945995, 28555583, 30268311, 30404214, 30404592, 30404693, 30404805, 30404858, 
        30820359, 30824708, 19209142, 19245461, 17050975, 17151529, 17410444, 17661947, 18877555, 21607123, 25162318, 
        25443214, 25495696, 22111360, 24298348, 27069846, 24055623, 24059189, 24007929, 24112267, 24124293, 24127174, 
        25843190, 27605238, 28955943, 29796603, 29796683, 29796712, 22955441, 18256369, 24964122, 24964171, 27424635, 
        18855948, 18943563, 17584993, 24470059, 26903700, 26903728, 17022380, 17031626, 17271570, 18021647, 20190582, 
        20662496, 20921195, 21949381, 26434779, 26435679, 18855526, 14158369, 21138460, 25375648, 23457285, 24434775, 
        16816732
    )
) as cte(project_namespace_id, traversal_ids)
WHERE id = cte.project_namespace_id;
                                                 QUERY PLAN
------------------------------------------------------------------------------------------------------
 Update on namespaces  (cost=1.30..714.69 rows=7 width=406) (actual time=82.846..82.848 rows=0 loops=1)
   ->  Nested Loop  (cost=1.30..714.69 rows=7 width=406) (actual time=0.083..2.222 rows=100 loops=1)
         ->  Nested Loop  (cost=0.87..690.50 rows=7 width=41) (actual time=0.070..1.537 rows=100 loops=1)
               ->  Index Scan using tmp_index_on_tmp_project_id_on_namespaces on namespaces namespaces_1  (cost=0.43..345.25 rows=100 width=14) (actual time=0.036..0.550 rows=100 loops=1)
                     Index Cond: (tmp_project_id = ANY ('{19568296,19655424,19993243,20081132,20630561,20839085,21649753,22847718,23512541,23526204,25969582,27668507,27918529,28599337,28921571,25037358,25336653,20802859,20466430,21324924,21628863,23544263,21525059,23495190,23921884,23924111,23949254,26543618,27792539,28933533,27051800,27286937,27650153,27038823,27040581,27831771,27945995,28555583,30268311,30404214,30404592,30404693,30404805,30404858,30820359,30824708,19209142,19245461,17050975,17151529,17410444,17661947,18877555,21607123,25162318,25443214,25495696,22111360,24298348,27069846,24055623,24059189,24007929,24112267,24124293,24127174,25843190,27605238,28955943,29796603,29796683,29796712,22955441,18256369,24964122,24964171,27424635,18855948,18943563,17584993,24470059,26903700,26903728,17022380,17031626,17271570,18021647,20190582,20662496,20921195,21949381,26434779,26435679,18855526,14158369,21138460,25375648,23457285,24434775,16816732}'::integer[]))
               ->  Index Scan using namespaces_pkey on namespaces n2  (cost=0.43..3.45 rows=1 width=35) (actual time=0.008..0.008 rows=1 loops=100)
                     Index Cond: (id = namespaces_1.parent_id)
         ->  Index Scan using namespaces_pkey on namespaces  (cost=0.43..3.45 rows=1 width=338) (actual time=0.003..0.003 rows=1 loops=100)
               Index Cond: (id = namespaces_1.id)
 Planning Time: 1.830 ms
 Execution Time: 83.017 ms
(11 rows)

DOWN

Schema migrations

== 20211018102252 AddIndexToGroupIdColumnOnWebhooksTable: reverting ===========
-- transaction_open?()
   -> 0.0000s
-- indexes(:web_hooks)
   -> 0.0031s
-- remove_index(:web_hooks, {:algorithm=>:concurrently, :name=>"index_on_group_id_on_webhooks"})
   -> 0.0016s
== 20211018102252 AddIndexToGroupIdColumnOnWebhooksTable: reverted (0.0066s) ==
== 20211018102152 AddIndexToTmpProjectIdColumnOnNamespacesTable: reverting ====
-- transaction_open?()
-> 0.0000s
-- indexes(:namespaces)
-> 0.0117s
-- remove_index(:namespaces, {:algorithm=>:concurrently, :name=>"tmp_index_on_tmp_project_id_on_namespaces"})
-> 0.0017s
== 20211018102152 AddIndexToTmpProjectIdColumnOnNamespacesTable: reverted (0.0154s)
== 20211018101852 AddFkToTmpProjectIdColumnOnNamespacesTable: reverting =======
-- remove_foreign_key(:namespaces, {:column=>:tmp_project_id})
-> 0.0068s
== 20211018101852 AddFkToTmpProjectIdColumnOnNamespacesTable: reverted (0.0068s)
== 20211018101034 AddTmpProjectIdColumnToNamespaces: reverting ================
-- remove_column(:namespaces, :tmp_project_id, :integer)
-> 0.0013s
== 20211018101034 AddTmpProjectIdColumnToNamespaces: reverted (0.0015s) =======

Note that for deletes the batch is much smaller 10 records vs 100 records and those already take ~250ms seconds to run.

Ruby snippet to run `down` migration

migration = Gitlab::BackgroundMigration::ProjectNamespaces::BackfillProjectNamespaces.new
migration.perform(13083, 31051707, 9970, 'down')
Nullify project's project_namespace_id

explain analyze 
UPDATE "projects" SET "project_namespace_id" = NULL 
WHERE "projects"."id" IN (
    19568296, 19655424, 19993243, 20081132, 20630561, 20839085, 21649753, 22847718, 23512541, 23526204, 25969582, 
    27668507, 27918529, 28599337, 28921571, 25037358, 25336653, 20802859, 20466430, 21324924, 21628863, 23544263, 
    21525059, 23495190, 23921884, 23924111, 23949254, 26543618, 27792539, 28933533, 27051800, 27286937, 27650153, 
    27038823, 27040581, 27831771, 27945995, 28555583, 30268311, 30404214, 30404592, 30404693, 30404805, 30404858, 
    30820359, 30824708, 19209142, 19245461, 17050975, 17151529, 17410444, 17661947, 18877555, 21607123, 25162318, 
    25443214, 25495696, 22111360, 24298348, 27069846, 24055623, 24059189, 24007929, 24112267, 24124293, 24127174, 
    25843190, 27605238, 28955943, 29796603, 29796683, 29796712, 22955441, 18256369, 24964122, 24964171, 27424635, 
    18855948, 18943563, 17584993, 24470059, 26903700, 26903728, 17022380, 17031626, 17271570, 18021647, 20190582, 
    20662496, 20921195, 21949381, 26434779, 26435679, 18855526, 14158369, 21138460, 25375648, 23457285, 24434775, 
    16816732
);
                                                 QUERY PLAN
------------------------------------------------------------------------------------------------------
 Update on projects  (cost=0.44..322.28 rows=100 width=819) (actual time=95.041..95.042 rows=0 loops=1)
   ->  Index Scan using projects_pkey on projects  (cost=0.44..322.28 rows=100 width=819) (actual time=0.060..2.189 rows=100 loops=1)
         Index Cond: (id = ANY ('{19568296,19655424,19993243,20081132,20630561,20839085,21649753,22847718,23512541,23526204,25969582,27668507,27918529,28599337,28921571,25037358,25336653,20802859,20466430,21324924,21628863,23544263,21525059,23495190,23921884,23924111,23949254,26543618,27792539,28933533,27051800,27286937,27650153,27038823,27040581,27831771,27945995,28555583,30268311,30404214,30404592,30404693,30404805,30404858,30820359,30824708,19209142,19245461,17050975,17151529,17410444,17661947,18877555,21607123,25162318,25443214,25495696,22111360,24298348,27069846,24055623,24059189,24007929,24112267,24124293,24127174,25843190,27605238,28955943,29796603,29796683,29796712,22955441,18256369,24964122,24964171,27424635,18855948,18943563,17584993,24470059,26903700,26903728,17022380,17031626,17271570,18021647,20190582,20662496,20921195,21949381,26434779,26435679,18855526,14158369,21138460,25375648,23457285,24434775,16816732}'::integer[]))
 Planning Time: 0.669 ms
 Execution Time: 95.286 ms
(5 rows)
Delete project_namespace

explain analyze DELETE FROM "namespaces" 
WHERE "namespaces"."type" = 'Project' AND "namespaces"."tmp_project_id" IN (
    19568296, 19655424, 19993243, 20081132, 20630561, 20839085, 21649753, 22847718, 23512541, 23526204
);
                                     QUERY PLAN
-----------------------------------------------------------------------------------------------------------
 Delete on namespaces  (cost=0.56..3.32 rows=1 width=6) (actual time=0.470..0.470 rows=0 loops=1)
   ->  Index Scan using index_namespaces_on_type_and_id on namespaces  (cost=0.56..3.32 rows=1 width=6) (actual time=0.086..0.292 rows=10 loops=1)
         Index Cond: ((type)::text = 'Project'::text)
         Filter: (tmp_project_id = ANY ('{19568296,19655424,19993243,20081132,20630561,20839085,21649753,22847718,23512541,23526204}'::integer[]))
         Rows Removed by Filter: 90
 Planning Time: 0.329 ms
 Trigger for constraint fk_9e112565b7: time=1.998 calls=10
 Trigger for constraint fk_842649f2f5: time=2.417 calls=10
 Trigger for constraint fk_rails_497b4938ac: time=1.018 calls=10
 Trigger for constraint fk_rails_e0e0c4e4b1: time=1.198 calls=10
 Trigger for constraint fk_rails_20f694a960: time=1.139 calls=10
 Trigger for constraint fk_fdc0137e4a: time=3.240 calls=10
 Trigger for constraint fk_rails_a48597902f: time=0.784 calls=10
 Trigger for constraint fk_b91ddd9345: time=1.048 calls=10
 Trigger for constraint fk_2c9f941965: time=1.071 calls=10
 Trigger for constraint fk_rails_2b1896d021: time=0.620 calls=10
 Trigger for constraint fk_71625606ac: time=2.160 calls=10
 Trigger for constraint fk_9dc8b9d4b2: time=1.278 calls=10
 Trigger for constraint fk_rails_0bc80a4edc: time=0.761 calls=10
 Trigger for constraint fk_162941d509: time=2.304 calls=10
 Trigger for constraint fk_190e4fcc88: time=4.960 calls=10
 Trigger for constraint fk_1e9a074a35: time=2.716 calls=10
 Trigger for constraint fk_24b824da43: time=1.838 calls=10
 Trigger for constraint fk_33ae4d58d8: time=1.574 calls=10
 Trigger for constraint fk_61fbf6ca48: time=6.388 calls=10
 Trigger for constraint fk_7111b68cdb: time=1.934 calls=10
 Trigger for constraint fk_80aa8a1f95: time=3.281 calls=10
 Trigger for constraint fk_83319d9721: time=1.460 calls=10
 Trigger for constraint fk_88c725229f: time=1.460 calls=10
 Trigger for constraint fk_8c6f33cebe: time=1.355 calls=10
 Trigger for constraint fk_95650a40d4: time=2.264 calls=10
 Trigger for constraint fk_98f3d044fe: time=1.677 calls=10
 Trigger for constraint fk_a27c483435: time=3.661 calls=10
 Trigger for constraint fk_a4b8fefe3e: time=15.820 calls=10
 Trigger for constraint fk_b4eb82fe3c: time=1.261 calls=10
 Trigger for constraint fk_b74c45b71f: time=1.321 calls=10
 Trigger for constraint fk_c3d3cb5d0f: time=1.156 calls=10
 Trigger for constraint fk_e2595d00a1: time=1.801 calls=10
 Trigger for constraint fk_e7a0b20a6b: time=1.950 calls=10
 Trigger for constraint fk_e8a145f3a7: time=7.990 calls=10
 Trigger for constraint fk_e8fe908a34: time=3.318 calls=10
 Trigger for constraint fk_f081aa4489: time=4.918 calls=10
 Trigger for constraint fk_f5aa768998: time=1.092 calls=10
 Trigger for constraint fk_fd1858fefd: time=2.648 calls=10
 Trigger for constraint fk_projects_namespace_id: time=1.797 calls=10
 Trigger for constraint fk_rails_0062050394: time=1.107 calls=10
 Trigger for constraint fk_rails_04a93778d5: time=0.914 calls=10
 Trigger for constraint fk_rails_0adf75c347: time=1.595 calls=10
 Trigger for constraint fk_rails_1cdcbd7723: time=1.717 calls=10
 Trigger for constraint fk_rails_2020a7124a: time=1.822 calls=10
 Trigger for constraint fk_rails_22e312c530: time=2.320 calls=10
 Trigger for constraint fk_rails_246e0db83a: time=0.703 calls=10
 Trigger for constraint fk_rails_26f867598c: time=1.050 calls=10
 Trigger for constraint fk_rails_2b2353ca49: time=1.244 calls=10
 Trigger for constraint fk_rails_2ccfd420cc: time=1.839 calls=10
 Trigger for constraint fk_rails_306d459be7: time=0.860 calls=10
 Trigger for constraint fk_rails_31c3e0503a: time=0.994 calls=10
 Trigger for constraint fk_rails_37b6b4cdba: time=0.597 calls=10
 Trigger for constraint fk_rails_3896d4fae5: time=1.003 calls=10
 Trigger for constraint fk_rails_396841e79e: time=1.530 calls=10
 Trigger for constraint fk_rails_3b543909cb: time=0.624 calls=10
 Trigger for constraint fk_rails_3d28377556: time=1.173 calls=10
 Trigger for constraint fk_rails_41ff5fb854: time=0.717 calls=10
 Trigger for constraint fk_rails_45cc02a931: time=1.484 calls=10
 Trigger for constraint fk_rails_4b8c694a6c: time=0.953 calls=10
 Trigger for constraint fk_rails_4d2056ebd9: time=2.039 calls=10
 Trigger for constraint fk_rails_540627381a: time=0.892 calls=10
 Trigger for constraint fk_rails_5b3f2bc334: time=1.877 calls=10
 Trigger for constraint fk_rails_5be1abfc25: time=1.739 calls=10
 Trigger for constraint fk_rails_5c4391f60a: time=0.931 calls=10
 Trigger for constraint fk_rails_616ddd680a: time=0.944 calls=10
 Trigger for constraint fk_rails_61a572b41a: time=1.236 calls=10
 Trigger for constraint fk_rails_666166ea7b: time=0.751 calls=10
 Trigger for constraint fk_rails_745925b412: time=0.996 calls=10
 Trigger for constraint fk_rails_874c573878: time=1.092 calls=10
 Trigger for constraint fk_rails_8b5da859f9: time=0.910 calls=10
 Trigger for constraint fk_rails_982bb5daf1: time=0.623 calls=10
 Trigger for constraint fk_rails_9df4a56538: time=1.553 calls=10
 Trigger for constraint fk_rails_a0702c430b: time=1.100 calls=10
 Trigger for constraint fk_rails_a3c10bcf7d: time=1.241 calls=10
 Trigger for constraint fk_rails_a758021fb0: time=1.766 calls=10
 Trigger for constraint fk_rails_ae5da3409b: time=2.243 calls=10
 Trigger for constraint fk_rails_b53e481273: time=3.695 calls=10
 Trigger for constraint fk_rails_b565c8d16c: time=1.238 calls=10
 Trigger for constraint fk_rails_b82cea43a0: time=2.434 calls=10
 Trigger for constraint fk_rails_bdcf044f37: time=0.954 calls=10
 Trigger for constraint fk_rails_c1ac5161d8: time=2.962 calls=10
 Trigger for constraint fk_rails_c84404fb6c: time=0.895 calls=10
 Trigger for constraint fk_rails_d35697648e: time=2.288 calls=10
 Trigger for constraint fk_rails_d3a0488427: time=0.585 calls=10
 Trigger for constraint fk_rails_db58bbc5d7: time=1.863 calls=10
 Trigger for constraint fk_rails_e773444769: time=0.881 calls=10
 Trigger for constraint fk_rails_e87145115d: time=0.708 calls=10
 Trigger for constraint fk_rails_ece400c55a: time=1.370 calls=10
 Trigger for constraint fk_rails_f410736518: time=1.922 calls=10
 Trigger for constraint fk_rails_f9d9ed3308: time=2.021 calls=10
 Trigger for constraint fk_rails_c4dcba4a3e: time=1.429 calls=10
 Trigger for constraint fk_78c9eac821: time=1.419 calls=10
 Trigger for constraint fk_190a24754d: time=0.431 calls=10
 Execution Time: 174.781 ms
(100 rows)

#337100 (closed)

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

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 Alexandru Croitor

Merge request reports