explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hJYD

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 0.016 ↓ 0.0 0 1

Nested Loop (cost=42,579.07..44,769.58 rows=31 width=16) (actual time=0.016..0.016 rows=0 loops=1)

2. 0.000 0.015 ↓ 0.0 0 1

Nested Loop (cost=42,578.65..44,431.54 rows=41 width=16) (actual time=0.015..0.015 rows=0 loops=1)

3. 0.000 0.015 ↓ 0.0 0 1

Nested Loop (cost=4.69..19.40 rows=1 width=80) (actual time=0.015..0.015 rows=0 loops=1)

4. 0.001 0.015 ↓ 0.0 0 1

Nested Loop (cost=4.57..19.22 rows=1 width=96) (actual time=0.015..0.015 rows=0 loops=1)

5. 0.002 0.014 ↓ 0.0 0 1

Bitmap Heap Scan on person_assignment (cost=4.29..10.89 rows=1 width=16) (actual time=0.014..0.014 rows=0 loops=1)

  • Recheck Cond: (person_id = '8e459ecd-2208-44b9-836a-b9bbf182ec03'::uuid)
  • Filter: (state = 'ACTIVE'::text)
6. 0.012 0.012 ↓ 0.0 0 1

Bitmap Index Scan on idx_person_assignment_person_id (cost=0.00..4.29 rows=2 width=0) (actual time=0.012..0.012 rows=0 loops=1)

  • Index Cond: (person_id = '8e459ecd-2208-44b9-836a-b9bbf182ec03'::uuid)
7. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_organizational_unit_materialized_path_btree_idx on organizational_unit (cost=0.27..8.29 rows=1 width=112) (never executed)

  • Index Cond: (id = person_assignment.organizational_unit_id)
  • Filter: (state = 'ACTIVE'::text)
8. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_organizational_hierarchy on organizational_hierarchy (cost=0.12..0.17 rows=1 width=16) (never executed)

  • Index Cond: (id = organizational_unit.organizational_hierarchy_id)
  • Filter: (state = 'ACTIVE'::text)
9. 0.000 0.000 ↓ 0.0 0

Nested Loop Anti Join (cost=42,573.96..44,411.70 rows=45 width=16) (never executed)

10. 0.000 0.000 ↓ 0.0 0

Subquery Scan on alias_755097 (cost=42,573.39..43,374.19 rows=123 width=16) (never executed)

  • Filter: (alias_755097.r = 1)
11. 0.000 0.000 ↓ 0.0 0

WindowAgg (cost=42,573.39..43,066.19 rows=24,640 width=44) (never executed)

12. 0.000 0.000 ↓ 0.0 0

Sort (cost=42,573.39..42,634.99 rows=24,640 width=20) (never executed)

  • Sort Key: employee.person_id, employee.sort_code
13. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=216.16..40,776.06 rows=24,640 width=20) (never executed)

14. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=215.74..33,555.68 rows=9,585 width=16) (never executed)

15. 0.000 0.000 ↓ 0.0 0

Seq Scan on organizational_unit ou2 (cost=0.00..23.34 rows=2 width=16) (never executed)

  • Filter: ((materialized_path @> organizational_unit.materialized_path) AND (state = 'ACTIVE'::text))
16. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on organization_assignment (cost=215.74..16,699.97 rows=6,620 width=32) (never executed)

  • Recheck Cond: ((organizational_unit_id = ou2.id) AND (state = 'ACTIVE'::text))
17. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on organizational_assignment_org_unit_id_org_id_idx (cost=0.00..214.08 rows=6,620 width=0) (never executed)

  • Index Cond: (organizational_unit_id = ou2.id)
18. 0.000 0.000 ↓ 0.0 0

Index Scan using employee_organization_id_state_idx on employee (cost=0.42..0.65 rows=10 width=36) (never executed)

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

Nested Loop (cost=0.56..8.42 rows=1 width=16) (never executed)

20. 0.000 0.000 ↓ 0.0 0

Index Scan using person_to_person_type_person_idx on person_to_person_type (cost=0.42..8.24 rows=1 width=32) (never executed)

  • Index Cond: (person_id = alias_755097.person_id)
21. 0.000 0.000 ↓ 0.0 0

Index Scan using person_type_pkey on person_type (cost=0.14..0.16 rows=1 width=16) (never executed)

  • Index Cond: (id = person_to_person_type.person_type_id)
  • Filter: (base_type = 'INTERNAL'::text)
22. 0.000 0.000 ↓ 0.0 0

Index Only Scan using person_id_active_idx on person (cost=0.42..8.24 rows=1 width=16) (never executed)

  • Index Cond: (id = alias_755097.person_id)
  • Heap Fetches: 0
Planning time : 4.670 ms
Execution time : 0.163 ms