explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JVmP

Settings
# exclusive inclusive rows x rows loops node
1. 0.022 0.462 ↑ 1,984.5 2 1

Hash Right Join (cost=490.55..624.50 rows=3,969 width=1,218) (actual time=0.426..0.462 rows=2 loops=1)

  • Output: g.uuid, g.name, apg.child_group_uuid, g.parent_merge_strategy, g.policy, g.mergeable_policy
  • Hash Cond: (apg.parent_group_uuid = g.uuid)
  • Filter: ((aug.group_uuid IS NOT NULL) OR (apg.parent_group_uuid IS NOT NULL))
  • Rows Removed by Filter: 220
2.          

CTE all_user_groups

3. 0.025 0.025 ↑ 1.0 2 1

Seq Scan on authv3.user_groups (cost=0.00..3.15 rows=2 width=16) (actual time=0.018..0.025 rows=2 loops=1)

  • Output: user_groups.group_uuid
  • Filter: (user_groups.user_uuid = 'd6201550-4a60-4b2e-9320-d3f8dacfc5b7'::uuid)
  • Rows Removed by Filter: 90
4.          

CTE all_parent_groups

5. 0.002 0.038 ↑ 3,969.0 1 1

Recursive Union (cost=0.07..391.49 rows=3,969 width=32) (actual time=0.018..0.038 rows=1 loops=1)

6. 0.010 0.020 ↑ 9.0 1 1

Hash Join (cost=0.07..22.26 rows=9 width=32) (actual time=0.016..0.020 rows=1 loops=1)

  • Output: g_1.child_group_uuid, g_1.parent_group_uuid
  • Hash Cond: (g_1.child_group_uuid = aug_1.group_uuid)
7. 0.008 0.008 ↑ 19.1 46 1

Seq Scan on authv3.group_inheritance g_1 (cost=0.00..18.80 rows=880 width=32) (actual time=0.006..0.008 rows=46 loops=1)

  • Output: g_1.uuid, g_1.created_at, g_1.updated_at, g_1.parent_group_uuid, g_1.child_group_uuid
8. 0.002 0.002 ↑ 1.0 2 1

Hash (cost=0.04..0.04 rows=2 width=16) (actual time=0.002..0.002 rows=2 loops=1)

  • Output: aug_1.group_uuid
  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.000 0.000 ↑ 1.0 2 1

CTE Scan on all_user_groups aug_1 (cost=0.00..0.04 rows=2 width=16) (actual time=0.000..0.000 rows=2 loops=1)

  • Output: aug_1.group_uuid
10. 0.009 0.016 ↓ 0.0 0 1

Hash Join (cost=2.92..28.99 rows=396 width=32) (actual time=0.016..0.016 rows=0 loops=1)

  • Output: g2.child_group_uuid, g2.parent_group_uuid
  • Hash Cond: (g2.child_group_uuid = ag.parent_group_uuid)
11. 0.005 0.005 ↑ 19.1 46 1

Seq Scan on authv3.group_inheritance g2 (cost=0.00..18.80 rows=880 width=32) (actual time=0.003..0.005 rows=46 loops=1)

  • Output: g2.uuid, g2.created_at, g2.updated_at, g2.parent_group_uuid, g2.child_group_uuid
12. 0.001 0.002 ↑ 90.0 1 1

Hash (cost=1.80..1.80 rows=90 width=16) (actual time=0.002..0.002 rows=1 loops=1)

  • Output: ag.parent_group_uuid
  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.001 0.001 ↑ 90.0 1 1

WorkTable Scan on all_parent_groups ag (cost=0.00..1.80 rows=90 width=16) (actual time=0.001..0.001 rows=1 loops=1)

  • Output: ag.parent_group_uuid
14. 0.039 0.039 ↑ 3,969.0 1 1

CTE Scan on all_parent_groups apg (cost=0.00..79.38 rows=3,969 width=32) (actual time=0.019..0.039 rows=1 loops=1)

  • Output: apg.child_group_uuid, apg.parent_group_uuid
15. 0.122 0.401 ↑ 1.0 222 1

Hash (cost=93.14..93.14 rows=222 width=1,218) (actual time=0.401..0.401 rows=222 loops=1)

  • Output: g.uuid, g.name, g.parent_merge_strategy, g.policy, g.mergeable_policy, aug.group_uuid
  • Buckets: 1024 Batches: 1 Memory Usage: 208kB
16. 0.039 0.279 ↑ 1.0 222 1

Hash Left Join (cost=0.07..93.14 rows=222 width=1,218) (actual time=0.042..0.279 rows=222 loops=1)

  • Output: g.uuid, g.name, g.parent_merge_strategy, g.policy, g.mergeable_policy, aug.group_uuid
  • Hash Cond: (g.uuid = aug.group_uuid)
17. 0.210 0.210 ↑ 1.0 222 1

Seq Scan on authv3.groups g (cost=0.00..92.22 rows=222 width=1,202) (actual time=0.008..0.210 rows=222 loops=1)

  • Output: g.uuid, g.name, g.parent_merge_strategy, g.policy, g.mergeable_policy
18. 0.002 0.030 ↑ 1.0 2 1

Hash (cost=0.04..0.04 rows=2 width=16) (actual time=0.030..0.030 rows=2 loops=1)

  • Output: aug.group_uuid
  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
19. 0.028 0.028 ↑ 1.0 2 1

CTE Scan on all_user_groups aug (cost=0.00..0.04 rows=2 width=16) (actual time=0.020..0.028 rows=2 loops=1)

  • Output: aug.group_uuid
Planning time : 0.322 ms
Execution time : 0.530 ms