explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 66Gn

Settings
# exclusive inclusive rows x rows loops node
1. 0.021 800.001 ↑ 1.0 1 1

Hash Join (cost=91,296.04..91,690.80 rows=1 width=76) (actual time=799.994..800.001 rows=1 loops=1)

  • Hash Cond: ((ard.afternoon_type_id = atc_rel.wrat_id) AND (c.type_id = atc_rel.hct_id))
2.          

Initplan (forHash Join)

3. 0.019 0.019 ↑ 1.0 1 1

Seq Scan on hr_period (cost=0.00..1.20 rows=1 width=4) (actual time=0.016..0.019 rows=1 loops=1)

  • Filter: ((start_date <= (now())::date) AND (end_date >= (now())::date))
  • Rows Removed by Filter: 7
4. 0.007 0.007 ↑ 1.0 1 1

Seq Scan on hr_period hr_period_1 (cost=0.00..1.20 rows=1 width=4) (actual time=0.005..0.007 rows=1 loops=1)

  • Filter: ((start_date <= (now())::date) AND (end_date >= (now())::date))
  • Rows Removed by Filter: 7
5. 0.068 799.935 ↑ 6.5 2 1

Merge Join (cost=91,292.49..91,687.18 rows=13 width=20) (actual time=799.928..799.935 rows=2 loops=1)

  • Merge Cond: (ts.employee_id = c.emp_id)
  • Join Filter: (ard.date > (max(ts.date_aal)))
  • Rows Removed by Join Filter: 14
6. 0.000 793.151 ↑ 2.6 566 1

Finalize GroupAggregate (cost=90,825.80..91,201.27 rows=1,482 width=8) (actual time=792.163..793.151 rows=566 loops=1)

  • Group Key: ts.employee_id
7. 0.000 807.227 ↑ 1.8 1,678 1

Gather Merge (cost=90,825.80..91,171.63 rows=2,964 width=8) (actual time=792.149..807.227 rows=1,678 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
8. 2.595 2,358.225 ↑ 1.0 1,434 3

Sort (cost=89,825.78..89,829.48 rows=1,482 width=8) (actual time=785.926..786.075 rows=1,434 loops=3)

  • Sort Key: ts.employee_id
  • Sort Method: quicksort Memory: 137kB
  • Worker 0: Sort Method: quicksort Memory: 136kB
  • Worker 1: Sort Method: quicksort Memory: 136kB
9. 1,628.670 2,355.630 ↓ 1.3 1,876 3

Partial HashAggregate (cost=89,732.91..89,747.73 rows=1,482 width=8) (actual time=784.748..785.210 rows=1,876 loops=3)

  • Group Key: ts.employee_id
10. 726.960 726.960 ↑ 1.2 1,288,415 3

Parallel Seq Scan on hr_analytic_timesheet ts (cost=0.00..81,684.27 rows=1,609,727 width=8) (actual time=0.166..242.320 rows=1,288,415 loops=3)

11. 0.017 6.716 ↑ 1.9 16 1

Sort (cost=466.68..466.76 rows=30 width=24) (actual time=6.715..6.716 rows=16 loops=1)

  • Sort Key: ar.emp_id
  • Sort Method: quicksort Memory: 26kB
12. 2.836 6.699 ↑ 1.9 16 1

Hash Join (cost=18.67..465.95 rows=30 width=24) (actual time=0.170..6.699 rows=16 loops=1)

  • Hash Cond: (ard.absence_request_id = ar.id)
13. 3.778 3.778 ↑ 1.0 18,470 1

Seq Scan on cesbron_absence_request_date ard (cost=0.00..377.72 rows=18,470 width=12) (actual time=0.013..3.778 rows=18,470 loops=1)

  • Filter: afternoon
  • Rows Removed by Filter: 102
14. 0.006 0.085 ↑ 1.3 6 1

Hash (cost=18.57..18.57 rows=8 width=20) (actual time=0.085..0.085 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.014 0.079 ↑ 1.3 6 1

Nested Loop (cost=1.70..18.57 rows=8 width=20) (actual time=0.055..0.079 rows=6 loops=1)

16. 0.027 0.027 ↑ 1.0 2 1

Index Scan using hr_holidays_counter_pkey on hr_holidays_counter c (cost=0.28..4.71 rows=2 width=12) (actual time=0.023..0.027 rows=2 loops=1)

  • Index Cond: (id = ANY ('{10,11}'::integer[]))
17. 0.022 0.038 ↑ 1.7 3 2

Bitmap Heap Scan on cesbron_absence_request ar (cost=1.42..6.88 rows=5 width=8) (actual time=0.015..0.019 rows=3 loops=2)

  • Recheck Cond: (emp_id = c.emp_id)
  • Filter: ((state)::text = ANY ('{validated,confirmed}'::text[]))
  • Heap Blocks: exact=6
18. 0.016 0.016 ↑ 1.7 3 2

Bitmap Index Scan on cesbron_absence_request_emp_id_index (cost=0.00..1.42 rows=5 width=0) (actual time=0.008..0.008 rows=3 loops=2)

  • Index Cond: (emp_id = c.emp_id)
19. 0.007 0.019 ↑ 1.0 6 1

Hash (cost=1.06..1.06 rows=6 width=8) (actual time=0.019..0.019 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
20. 0.012 0.012 ↑ 1.0 6 1

Seq Scan on hr_week_act_type_hol_count_type_rel atc_rel (cost=0.00..1.06 rows=6 width=8) (actual time=0.009..0.012 rows=6 loops=1)

Planning time : 3.803 ms