explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WyGf

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 0.816 ↓ 167.0 167 1

Nested Loop (cost=20.46..99.01 rows=1 width=80) (actual time=0.092..0.816 rows=167 loops=1)

2. 0.000 0.123 ↑ 1.0 1 1

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

3. 0.035 0.119 ↑ 1.0 1 1

Nested Loop (cost=0.15..9.61 rows=1 width=80) (actual time=0.042..0.119 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.078 0.078 ↑ 1.0 1 26

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

  • Filter: ((state = 'ACTIVE'::text) AND (person_id = '8e459ecd-2208-44b9-836a-b9bbf182ec03'::uuid))
  • Rows Removed by Filter: 28
6. 0.004 0.004 ↑ 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.004 rows=1 loops=1)

  • Index Cond: (id = organizational_unit.organizational_hierarchy_id)
  • Filter: (state = 'ACTIVE'::text)
7. 0.066 0.682 ↓ 55.7 167 1

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

8. 0.049 0.168 ↓ 56.0 448 1

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

9. 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
10. 0.077 0.108 ↑ 1.0 448 1

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

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

  • Index Cond: (organizational_unit_id = ou2.id)
12. 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=36) (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.509 ms
Execution time : 0.864 ms