explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IHko

Settings
# exclusive inclusive rows x rows loops node
1. 9.452 39.396 ↓ 4,342.0 4,342 1

Nested Loop (cost=20.46..99.28 rows=1 width=80) (actual time=0.115..39.396 rows=4,342 loops=1)

  • Join Filter: (organizational_unit.id = person_assignment.organizational_unit_id)
  • Rows Removed by Join Filter: 107047
2. 0.412 14.580 ↓ 3,841.0 3,841 1

Nested Loop (cost=20.46..97.56 rows=1 width=64) (actual time=0.107..14.580 rows=3,841 loops=1)

3. 0.013 0.076 ↓ 26.0 26 1

Nested Loop (cost=0.29..16.34 rows=1 width=48) (actual time=0.010..0.076 rows=26 loops=1)

4. 0.011 0.011 ↓ 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.005..0.011 rows=26 loops=1)

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

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

  • Index Cond: (id = organizational_unit.organizational_hierarchy_id)
  • Filter: (state = 'ACTIVE'::text)
6. 0.000 14.092 ↓ 49.3 148 26

Nested Loop (cost=20.17..81.16 rows=3 width=20) (actual time=0.028..0.542 rows=148 loops=26)

7. 1.196 3.900 ↓ 49.5 396 26

Nested Loop (cost=19.90..78.12 rows=8 width=16) (actual time=0.027..0.150 rows=396 loops=26)

8. 0.260 0.260 ↓ 4.0 4 26

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

  • Index Cond: (state = 'ACTIVE'::text)
  • Filter: (materialized_path @> organizational_unit.materialized_path)
  • Rows Removed by Filter: 22
9. 1.692 2.444 ↑ 4.1 110 94

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

  • Recheck Cond: ((organizational_unit_id = ou2.id) AND (state = 'ACTIVE'::text))
  • Heap Blocks: exact=897
10. 0.752 0.752 ↑ 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.008..0.008 rows=110 loops=94)

  • Index Cond: (organizational_unit_id = ou2.id)
11. 10.304 10.304 ↓ 0.0 0 10,304

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=10,304)

  • Index Cond: ((organization_id = organization_assignment.organization_id) AND (state = 'ACTIVE'::text))
12. 15.364 15.364 ↑ 1.0 29 3,841

Seq Scan on person_assignment (cost=0.00..1.36 rows=29 width=32) (actual time=0.001..0.004 rows=29 loops=3,841)

  • Filter: (state = 'ACTIVE'::text)
Planning time : 0.544 ms
Execution time : 39.632 ms