explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ut7L

Settings
# exclusive inclusive rows x rows loops node
1. 0.194 23.667 ↓ 156.0 156 1

Nested Loop (cost=81.68..102.82 rows=1 width=16) (actual time=18.207..23.667 rows=156 loops=1)

  • Join Filter: (organizational_unit.organizational_hierarchy_id = organizational_hierarchy.id)
2. 0.029 23.473 ↓ 156.0 156 1

Nested Loop (cost=81.68..101.80 rows=1 width=32) (actual time=18.202..23.473 rows=156 loops=1)

3. 1.936 23.288 ↓ 156.0 156 1

Nested Loop (cost=81.53..93.55 rows=1 width=32) (actual time=18.196..23.288 rows=156 loops=1)

  • Join Filter: (organizational_unit.id = person_assignment.organizational_unit_id)
  • Rows Removed by Join Filter: 1716
4. 0.326 15.736 ↓ 1,872.0 1,872 1

Nested Loop (cost=81.53..92.10 rows=1 width=48) (actual time=1.660..15.736 rows=1,872 loops=1)

5. 0.018 0.018 ↓ 26.0 26 1

Seq Scan on organizational_unit (cost=0.00..1.32 rows=1 width=64) (actual time=0.009..0.018 rows=26 loops=1)

  • Filter: (state = 'ACTIVE'::text)
6. 0.936 15.392 ↓ 72.0 72 26

Nested Loop Anti Join (cost=81.53..90.77 rows=1 width=16) (actual time=0.300..0.592 rows=72 loops=26)

7. 0.390 10.712 ↓ 72.0 72 26

Subquery Scan on alias_755097 (cost=81.25..82.29 rows=1 width=16) (actual time=0.298..0.412 rows=72 loops=26)

  • Filter: (alias_755097.r = 1)
  • Rows Removed by Filter: 76
8. 2.262 10.322 ↓ 4.6 148 26

WindowAgg (cost=81.25..81.89 rows=32 width=44) (actual time=0.297..0.397 rows=148 loops=26)

9. 1.404 8.060 ↓ 4.6 148 26

Sort (cost=81.25..81.33 rows=32 width=20) (actual time=0.295..0.310 rows=148 loops=26)

  • Sort Key: employee.person_id, employee.sort_code
  • Sort Method: quicksort Memory: 25kB
10. 0.692 6.656 ↓ 4.6 148 26

Hash Join (cost=72.42..80.45 rows=32 width=20) (actual time=0.219..0.256 rows=148 loops=26)

  • Hash Cond: (employee.organization_id = organization_assignment.organization_id)
11. 0.348 0.348 ↑ 1.0 167 12

Seq Scan on employee (cost=0.00..7.09 rows=167 width=36) (actual time=0.002..0.029 rows=167 loops=12)

  • Filter: (state = 'ACTIVE'::text)
12. 1.404 5.616 ↓ 4.6 396 26

Hash (cost=71.34..71.34 rows=86 width=16) (actual time=0.216..0.216 rows=396 loops=26)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
13. 1.466 4.212 ↓ 4.6 396 26

Nested Loop (cost=19.75..71.34 rows=86 width=16) (actual time=0.027..0.162 rows=396 loops=26)

14. 0.208 0.208 ↓ 4.0 4 26

Seq Scan on organizational_unit ou2 (cost=0.00..1.39 rows=1 width=16) (actual time=0.004..0.008 rows=4 loops=26)

  • Filter: ((materialized_path @> organizational_unit.materialized_path) AND (state = 'ACTIVE'::text))
  • Rows Removed by Filter: 22
15. 1.974 2.538 ↑ 4.1 110 94

Bitmap Heap Scan on organization_assignment (cost=19.75..65.47 rows=448 width=32) (actual time=0.008..0.027 rows=110 loops=94)

  • Recheck Cond: ((organizational_unit_id = ou2.id) AND (state = 'ACTIVE'::text))
  • Heap Blocks: exact=897
16. 0.564 0.564 ↑ 4.1 110 94

Bitmap Index Scan on organizational_assignment_org_unit_id_org_id_idx (cost=0.00..19.64 rows=448 width=0) (actual time=0.006..0.006 rows=110 loops=94)

  • Index Cond: (organizational_unit_id = ou2.id)
17. 0.000 3.744 ↓ 0.0 0 1,872

Nested Loop (cost=0.28..8.47 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=1,872)

18. 1.872 1.872 ↑ 1.0 1 1,872

Index Scan using person_to_person_type_person_idx on person_to_person_type (cost=0.14..8.16 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=1,872)

  • Index Cond: (person_id = alias_755097.person_id)
19. 1.872 1.872 ↓ 0.0 0 1,872

Index Scan using person_type_pkey on person_type (cost=0.14..0.22 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=1,872)

  • Index Cond: (id = person_to_person_type.person_type_id)
  • Filter: (base_type = 'INTERNAL'::text)
  • Rows Removed by Filter: 1
20. 5.616 5.616 ↑ 1.0 1 1,872

Seq Scan on person_assignment (cost=0.00..1.44 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=1,872)

  • Filter: ((state = 'ACTIVE'::text) AND (person_id = '8e459ecd-2208-44b9-836a-b9bbf182ec03'::uuid))
  • Rows Removed by Filter: 28
21. 0.156 0.156 ↑ 1.0 1 156

Index Only Scan using person_id_state_idx on person (cost=0.14..8.16 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=156)

  • Index Cond: (id = alias_755097.person_id)
  • Heap Fetches: 156
22. 0.000 0.000 ↑ 1.0 1 156

Seq Scan on organizational_hierarchy (cost=0.00..1.01 rows=1 width=16) (actual time=0.000..0.000 rows=1 loops=156)

  • Filter: (state = 'ACTIVE'::text)
Planning time : 1.559 ms
Execution time : 23.798 ms