explain.depesz.com

PostgreSQL's explain analyze made readable

Result: B6wI

Settings
# exclusive inclusive rows x rows loops node
1. 0.016 0.739 ↓ 156.0 156 1

Nested Loop (cost=81.46..99.04 rows=1 width=64) (actual time=0.635..0.739 rows=156 loops=1)

2. 0.000 0.126 ↑ 1.0 1 1

Nested Loop (cost=0.29..17.79 rows=1 width=64) (actual time=0.047..0.126 rows=1 loops=1)

3. 0.013 0.123 ↑ 1.0 1 1

Nested Loop (cost=0.15..9.61 rows=1 width=80) (actual time=0.044..0.123 rows=1 loops=1)

  • Join Filter: (organizational_unit.id = person_assignment.organizational_unit_id)
  • Rows Removed by Join Filter: 25
4. 0.006 0.006 ↓ 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.006 rows=26 loops=1)

  • Index Cond: (state = 'ACTIVE'::text)
5. 0.104 0.104 ↑ 1.0 1 26

Seq Scan on person_assignment (cost=0.00..1.44 rows=1 width=32) (actual time=0.003..0.004 rows=1 loops=26)

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

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

  • Index Cond: (id = organizational_unit.organizational_hierarchy_id)
  • Filter: (state = 'ACTIVE'::text)
7. 0.046 0.597 ↓ 52.0 156 1

HashAggregate (cost=81.16..81.19 rows=3 width=16) (actual time=0.588..0.597 rows=156 loops=1)

  • Group Key: employee.person_id
8. 0.000 0.551 ↓ 55.7 167 1

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

9. 0.046 0.162 ↓ 56.0 448 1

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

10. 0.011 0.011 ↑ 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.011 rows=1 loops=1)

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

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

  • Recheck Cond: ((organizational_unit_id = ou2.id) AND (state = 'ACTIVE'::text))
  • Heap Blocks: exact=39
12. 0.032 0.032 ↑ 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.032..0.032 rows=448 loops=1)

  • Index Cond: (organizational_unit_id = ou2.id)
13. 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))
Planning time : 0.519 ms
Execution time : 0.788 ms