explain.depesz.com

PostgreSQL's explain analyze made readable

Result: whxZ

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 0.079 ↓ 0.0 0 1

GroupAggregate (cost=106.97..145.54 rows=1 width=12) (actual time=0.079..0.079 rows=0 loops=1)

  • Group Key: tb.start_date
2.          

CTE emp_data

3. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.14..95.81 rows=8 width=32) (never executed)

4. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.85..92.16 rows=1 width=24) (never executed)

5. 0.000 0.000 ↓ 0.0 0

Index Scan using i_emp_user_id on employee emp (cost=0.42..14.05 rows=13 width=16) (never executed)

  • Index Cond: (user_id = 3397025)
6. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_emp_dep_eid_del on department_employee dep (cost=0.42..5.88 rows=13 width=16) (never executed)

  • Index Cond: (employee_id = emp.id)
7. 0.000 0.000 ↓ 0.0 0

Index Scan using department_position_dep_idx on department_position dp (cost=0.29..3.59 rows=6 width=16) (never executed)

  • Index Cond: (department_id = dep.department_id)
  • Filter: (deleted = 'N'::bpchar)
8.          

Initplan (for GroupAggregate)

9. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.00..0.02 rows=1 width=8) (never executed)

10. 0.000 0.000 ↓ 0.0 0

CTE Scan on emp_data (cost=0.00..0.16 rows=8 width=8) (never executed)

11. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.00..0.02 rows=1 width=8) (never executed)

12. 0.000 0.000 ↓ 0.0 0

CTE Scan on emp_data emp_data_1 (cost=0.00..0.16 rows=8 width=8) (never executed)

13. 0.000 0.076 ↓ 0.0 0 1

Nested Loop (cost=11.13..49.28 rows=81 width=12) (actual time=0.076..0.076 rows=0 loops=1)

  • Join Filter: (sr.timeblock_id <> tb.id)
14. 0.000 0.076 ↓ 0.0 0 1

Nested Loop (cost=10.70..17.80 rows=1 width=12) (actual time=0.076..0.076 rows=0 loops=1)

15. 0.001 0.076 ↓ 0.0 0 1

Nested Loop (cost=10.07..15.15 rows=1 width=20) (actual time=0.076..0.076 rows=0 loops=1)

16. 0.000 0.075 ↓ 0.0 0 1

Nested Loop (cost=0.99..5.04 rows=1 width=36) (actual time=0.075..0.075 rows=0 loops=1)

17. 0.075 0.075 ↓ 0.0 0 1

Index Scan using i_timeblock_start on timeblock tb (cost=0.57..2.59 rows=1 width=28) (actual time=0.075..0.075 rows=0 loops=1)

  • Index Cond: ((start_date >= now()) AND (start_date >= '2019-11-01'::date) AND (start_date <= '2019-11-30'::date))
  • Filter: ((date_published IS NOT NULL) AND (last_published = 'Y'::bpchar) AND (shift_type = 2))
18. 0.000 0.000 ↓ 0.0 0

Index Only Scan using i_position_id on "position" pos (cost=0.42..2.44 rows=1 width=8) (never executed)

  • Index Cond: (id = tb.position_id)
  • Heap Fetches: 0
19. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on employee_position ep (cost=9.08..10.10 rows=1 width=8) (never executed)

  • Recheck Cond: ((employee_id = $3) AND (position_id = pos.id))
  • Filter: (deleted = 'N'::bpchar)
20. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=9.08..9.08 rows=1 width=0) (never executed)

21. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on emp_pos_employee_id (cost=0.00..3.47 rows=272 width=0) (never executed)

  • Index Cond: (employee_id = $3)
22. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on emp_pos_position_id (cost=0.00..5.34 rows=388 width=0) (never executed)

  • Index Cond: (position_id = pos.id)
23. 0.000 0.000 ↓ 0.0 0

Index Scan using i_schedule_idtempn on schedule sch (cost=0.63..2.65 rows=1 width=8) (never executed)

  • Index Cond: (id = tb.schedule_id)
  • Filter: ((hashed SubPlan 4) OR (hashed SubPlan 5))
24.          

SubPlan (for Index Scan)

25. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.00..0.02 rows=1 width=8) (never executed)

26. 0.000 0.000 ↓ 0.0 0

CTE Scan on emp_data emp_data_2 (cost=0.00..0.16 rows=8 width=8) (never executed)

27. 0.000 0.000 ↓ 0.0 0

CTE Scan on emp_data emp_data_3 (cost=0.00..0.16 rows=8 width=8) (never executed)

28. 0.000 0.000 ↓ 0.0 0

Index Scan using shift_request_employee on shift_request sr (cost=0.42..30.47 rows=81 width=8) (never executed)

  • Index Cond: (requesting_employee_id = $4)