explain.depesz.com

PostgreSQL's explain analyze made readable

Result: erxT

Settings
# exclusive inclusive rows x rows loops node
1. 27.642 203.610 ↓ 0.0 0 1

Insert on "Ad" (cost=757.01..876.01 rows=100 width=196) (actual time=203.610..203.610 rows=0 loops=1)

  • Conflict Resolution: UPDATE
  • Conflict Arbiter Indexes: iAd-UniqueByAdGroup
  • Tuples Inserted: 1000
  • Conflicting Tuples: 0
2.          

CTE pk_ids

3. 0.512 5.779 ↓ 38.5 1,000 1

Nested Loop (cost=0.29..757.00 rows=26 width=36) (actual time=0.282..5.779 rows=1,000 loops=1)

4. 0.267 0.267 ↓ 10.0 1,000 1

Function Scan on jsonb_each (cost=0.00..1.00 rows=100 width=64) (actual time=0.213..0.267 rows=1,000 loops=1)

5. 5.000 5.000 ↑ 1.0 1 1,000

Index Scan using "iAdGroup-UniqueByCampaign" on "AdGroup" ag (cost=0.29..7.55 rows=1 width=15) (actual time=0.005..0.005 rows=1 loops=1,000)

  • Index Cond: ("ExtAdGroupId" = (jsonb_each.value #>> '{}'::text[]))
  • Filter: ("MkTypeAdGroup" = '6'::bigint)
6. 12.968 175.968 ↓ 10.0 1,000 1

Function Scan on json_populate_recordset (cost=0.00..119.00 rows=100 width=196) (actual time=10.839..175.968 rows=1,000 loops=1)

  • Filter: ((SubPlan 3) IS NOT NULL)
7.          

SubPlan (for Function Scan)

8. 84.000 84.000 ↑ 1.0 1 1,000

CTE Scan on pk_ids pk_ids_1 (cost=0.00..0.58 rows=1 width=4) (actual time=0.042..0.084 rows=1 loops=1,000)

  • Filter: ("ExtAdId" = json_populate_recordset."ExtAdId")
  • Rows Removed by Filter: 999
9. 79.000 79.000 ↑ 1.0 1 1,000

CTE Scan on pk_ids (cost=0.00..0.58 rows=1 width=4) (actual time=0.040..0.079 rows=1 loops=1,000)

  • Filter: ("ExtAdId" = json_populate_recordset."ExtAdId")
  • Rows Removed by Filter: 999
Planning time : 2.099 ms
Execution time : 227.587 ms
Trigger times:
Trigger Name:Total time:Calls:Average time:
for constraint rAd-MkTypeAd 12.048 ms 1000 0.012 ms
for constraint rAd-AdGroup 11.594 ms 1000 0.012 ms