explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KW1i

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 1.429 ↓ 167.0 167 1

Nested Loop (cost=0.72..30.18 rows=1 width=80) (actual time=0.064..1.429 rows=167 loops=1)

  • Join Filter: (ou2.materialized_path @> organizational_unit.materialized_path)
  • Rows Removed by Join Filter: 668
2. 0.134 0.637 ↓ 167.0 835 1

Nested Loop (cost=0.57..29.18 rows=5 width=96) (actual time=0.051..0.637 rows=835 loops=1)

3. 0.015 0.169 ↓ 167.0 167 1

Nested Loop (cost=0.29..27.55 rows=1 width=96) (actual time=0.047..0.169 rows=167 loops=1)

4. 0.000 0.121 ↑ 1.0 1 1

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

5. 0.006 0.118 ↑ 1.0 1 1

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

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

  • Index Cond: (state = 'ACTIVE'::text)
7. 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
8. 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)
9. 0.033 0.033 ↑ 1.0 167 1

Seq Scan on employee (cost=0.00..8.09 rows=167 width=32) (actual time=0.001..0.033 rows=167 loops=1)

  • Filter: (state = 'ACTIVE'::text)
10. 0.334 0.334 ↑ 1.0 5 167

Index Scan using organization_assignment_organization_id_active_idx on organization_assignment (cost=0.28..1.58 rows=5 width=32) (actual time=0.001..0.002 rows=5 loops=167)

  • Index Cond: (organization_id = employee.organization_id)
11. 0.835 0.835 ↑ 1.0 1 835

Index Scan using idx_organizational_unit_materialized_path_btree_idx on organizational_unit ou2 (cost=0.15..0.19 rows=1 width=48) (actual time=0.000..0.001 rows=1 loops=835)

  • Index Cond: (id = organization_assignment.organizational_unit_id)
  • Filter: (state = 'ACTIVE'::text)
Planning time : 1.439 ms
Execution time : 1.505 ms