explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MeKU

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 1.083 ↓ 156.0 156 1

Nested Loop (cost=89.93..120.21 rows=1 width=16) (actual time=0.652..1.083 rows=156 loops=1)

2. 0.000 0.936 ↓ 156.0 156 1

Nested Loop Anti Join (cost=89.79..113.37 rows=1 width=16) (actual time=0.649..0.936 rows=156 loops=1)

3. 0.042 0.679 ↓ 156.0 156 1

Nested Loop (cost=89.49..99.02 rows=1 width=16) (actual time=0.644..0.679 rows=156 loops=1)

4. 0.003 0.057 ↓ 29.0 29 1

Nested Loop (cost=8.33..17.76 rows=1 width=55) (actual time=0.025..0.057 rows=29 loops=1)

5. 0.007 0.025 ↓ 29.0 29 1

Hash Join (cost=8.18..9.59 rows=1 width=71) (actual time=0.021..0.025 rows=29 loops=1)

  • Hash Cond: (person_assignment.organizational_unit_id = organizational_unit.id)
6. 0.004 0.004 ↑ 1.0 29 1

Seq Scan on person_assignment (cost=0.00..1.29 rows=29 width=39) (actual time=0.003..0.004 rows=29 loops=1)

7. 0.004 0.014 ↓ 26.0 26 1

Hash (cost=8.17..8.17 rows=1 width=64) (actual time=0.014..0.014 rows=26 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
8. 0.010 0.010 ↓ 26.0 26 1

Index Scan using idx_organizational_unit_state on organizational_unit (cost=0.15..8.17 rows=1 width=64) (actual time=0.004..0.010 rows=26 loops=1)

  • Index Cond: (state = 'ACTIVE'::text)
9. 0.029 0.029 ↑ 1.0 1 29

Index Scan using pk_organizational_hierarchy on organizational_hierarchy (cost=0.15..8.17 rows=1 width=16) (actual time=0.000..0.001 rows=1 loops=29)

  • Index Cond: (id = organizational_unit.organizational_hierarchy_id)
  • Filter: (state = 'ACTIVE'::text)
10. 0.029 0.580 ↓ 1.7 5 29

HashAggregate (cost=81.17..81.20 rows=3 width=16) (actual time=0.020..0.020 rows=5 loops=29)

  • Group Key: employee.person_id
11. 0.015 0.551 ↓ 2.0 6 29

Result (cost=20.17..81.16 rows=3 width=16) (actual time=0.002..0.019 rows=6 loops=29)

  • One-Time Filter: ((person_assignment.person_id = '8e459ecd-2208-44b9-836a-b9bbf182ec03'::uuid) AND (person_assignment.state = 'ACTIVE'::text))
12. 0.000 0.536 ↓ 55.7 167 1

Nested Loop (cost=20.17..81.16 rows=3 width=16) (actual time=0.044..0.536 rows=167 loops=1)

13. 0.039 0.153 ↓ 56.0 448 1

Nested Loop (cost=19.90..78.12 rows=8 width=16) (actual time=0.041..0.153 rows=448 loops=1)

14. 0.010 0.010 ↑ 1.0 1 1

Index Scan using idx_organizational_unit_state on organizational_unit ou2 (cost=0.15..8.17 rows=1 width=16) (actual time=0.005..0.010 rows=1 loops=1)

  • Index Cond: (state = 'ACTIVE'::text)
  • Filter: (materialized_path @> organizational_unit.materialized_path)
  • Rows Removed by Filter: 25
15. 0.075 0.104 ↑ 1.0 448 1

Bitmap Heap Scan on organization_assignment (cost=19.75..65.47 rows=448 width=32) (actual time=0.033..0.104 rows=448 loops=1)

  • Recheck Cond: ((organizational_unit_id = ou2.id) AND (state = 'ACTIVE'::text))
  • Heap Blocks: exact=39
16. 0.029 0.029 ↑ 1.0 448 1

Bitmap Index Scan on organizational_assignment_org_unit_id_org_id_idx (cost=0.00..19.64 rows=448 width=0) (actual time=0.029..0.029 rows=448 loops=1)

  • Index Cond: (organizational_unit_id = ou2.id)
17. 0.448 0.448 ↓ 0.0 0 448

Index Scan using employee_organization_id_state_idx on employee (cost=0.27..0.35 rows=3 width=32) (actual time=0.001..0.001 rows=0 loops=448)

  • Index Cond: ((organization_id = organization_assignment.organization_id) AND (state = 'ACTIVE'::text))
18. 0.000 0.312 ↓ 0.0 0 156

Nested Loop (cost=0.29..7.31 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=156)

19. 0.156 0.156 ↑ 1.0 1 156

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

  • Index Cond: (person_id = employee.person_id)
20. 0.156 0.156 ↓ 0.0 0 156

Index Scan using person_type_pkey on person_type (cost=0.15..0.48 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=156)

  • Index Cond: (id = person_to_person_type.person_type_id)
  • Filter: (base_type = 'INTERNAL'::text)
  • Rows Removed by Filter: 1
21. 0.156 0.156 ↑ 1.0 1 156

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

  • Index Cond: (id = employee.person_id)
Planning time : 1.047 ms
Execution time : 1.141 ms