explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tpVQ

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

CTE Scan on incentive_day (cost=7,869.35..7,869.37 rows=1 width=176) (actual time=52.839..52.839 rows=0 loops=1)

2.          

CTE calculated_group_incentives_but_individual_with

3. 0.000 0.000 ↓ 0.0 0

Seq Scan on base_configuration (cost=0.00..1.48 rows=1 width=6) (never executed)

  • Filter: ((fk_domain = 1) AND ((configuration_key)::text = 'calculated_group_incentives_but_individual_with'::text))
4.          

CTE max_minutes_employees

5. 0.078 4.681 ↓ 20.0 20 1

GroupAggregate (cost=7,117.34..7,117.37 rows=1 width=20) (actual time=4.596..4.681 rows=20 loops=1)

  • Group Key: p.date_taken, p.fk_employee, ped.minutes_theoric
6. 0.103 4.603 ↓ 670.0 670 1

Sort (cost=7,117.34..7,117.34 rows=1 width=16) (actual time=4.589..4.603 rows=670 loops=1)

  • Sort Key: p.date_taken, p.fk_employee, ped.minutes_theoric
  • Sort Method: quicksort Memory: 56kB
7. 0.086 4.500 ↓ 670.0 670 1

Nested Loop (cost=0.42..7,117.33 rows=1 width=16) (actual time=0.616..4.500 rows=670 loops=1)

8. 0.014 0.014 ↓ 6.7 20 1

Index Scan using unique_prod_efficiency_day on prod_efficiency_day ped (cost=0.42..14.77 rows=3 width=12) (actual time=0.008..0.014 rows=20 loops=1)

  • Index Cond: ((date_taken >= '2019-04-01'::date) AND (date_taken <= '2019-04-03'::date))
9. 2.480 4.400 ↑ 50.0 34 20

Append (cost=0.00..2,350.51 rows=1,701 width=12) (actual time=0.203..0.220 rows=34 loops=20)

10. 0.000 0.000 ↓ 0.0 0 20

Seq Scan on production p (cost=0.00..0.00 rows=1 width=12) (actual time=0.000..0.000 rows=0 loops=20)

  • Filter: ((ped.date_taken = date_taken) AND (ped.fk_employee = fk_employee))
11. 0.020 0.020 ↓ 0.0 0 20

Index Scan using _hyper_39_96_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_96_chunk p_1 (cost=0.29..85.75 rows=37 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
12. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_97_chunk p_2 (cost=4.68..32.48 rows=39 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
13. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_97_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.67 rows=39 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
14. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_98_chunk p_3 (cost=4.46..41.18 rows=17 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
15. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_98_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.45 rows=17 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
16. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_99_chunk p_4 (cost=4.56..22.83 rows=28 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
17. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_99_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.56 rows=28 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
18. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_100_chunk p_5 (cost=4.47..46.86 rows=18 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
19. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_100_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.46 rows=18 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
20. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_101_chunk p_6 (cost=4.70..30.26 rows=41 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
21. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_101_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.69 rows=41 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
22. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_102_chunk p_7 (cost=4.51..55.29 rows=22 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
23. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_102_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.50 rows=22 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
24. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_103_chunk p_8 (cost=4.46..39.81 rows=18 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
25. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_103_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.46 rows=18 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
26. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_104_chunk p_9 (cost=4.41..35.34 rows=13 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
27. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_104_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.41 rows=13 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
28. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_105_chunk p_10 (cost=4.71..81.60 rows=42 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
29. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_105_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.70 rows=42 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
30. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_106_chunk p_11 (cost=4.70..25.72 rows=41 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
31. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_106_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.69 rows=41 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
32. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_107_chunk p_12 (cost=4.80..30.52 rows=51 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
33. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_107_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.79 rows=51 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
34. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_108_chunk p_13 (cost=4.50..43.02 rows=21 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
35. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_108_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.49 rows=21 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
36. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_109_chunk p_14 (cost=4.44..36.31 rows=16 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
37. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_109_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.44 rows=16 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
38. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_110_chunk p_15 (cost=4.74..21.29 rows=45 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
39. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_110_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.73 rows=45 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
40. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_111_chunk p_16 (cost=4.58..52.70 rows=29 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
41. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_111_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.57 rows=29 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
42. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_112_chunk p_17 (cost=4.48..17.76 rows=20 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
43. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_112_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.48 rows=20 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
44. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_113_chunk p_18 (cost=4.60..27.13 rows=31 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
45. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_113_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.59 rows=31 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
46. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_114_chunk p_19 (cost=4.81..26.00 rows=52 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
47. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_114_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.80 rows=52 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
48. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_115_chunk p_20 (cost=4.71..50.11 rows=42 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
49. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_115_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.70 rows=42 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
50. 0.020 0.020 ↓ 0.0 0 20

Index Scan using _hyper_39_116_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_116_chunk p_21 (cost=0.28..48.54 rows=23 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
51. 0.020 0.020 ↓ 0.0 0 20

Index Scan using _hyper_39_117_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_117_chunk p_22 (cost=0.28..37.45 rows=20 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
52. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_118_chunk p_23 (cost=4.46..50.44 rows=17 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
53. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_118_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.46 rows=17 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
54. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_119_chunk p_24 (cost=4.46..49.25 rows=17 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
55. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_119_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.45 rows=17 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
56. 0.020 0.020 ↓ 0.0 0 20

Index Scan using _hyper_39_120_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_120_chunk p_25 (cost=0.28..44.82 rows=17 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
57. 0.020 0.020 ↓ 0.0 0 20

Index Scan using _hyper_39_121_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_121_chunk p_26 (cost=0.28..31.96 rows=14 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
58. 0.020 0.020 ↓ 0.0 0 20

Index Scan using _hyper_39_122_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_122_chunk p_27 (cost=0.28..13.73 rows=10 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
59. 0.020 0.020 ↓ 0.0 0 20

Index Scan using _hyper_39_123_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_123_chunk p_28 (cost=0.29..67.02 rows=34 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
60. 0.020 0.020 ↓ 0.0 0 20

Index Scan using _hyper_39_124_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_124_chunk p_29 (cost=0.29..79.49 rows=33 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
61. 0.020 0.020 ↓ 0.0 0 20

Index Scan using _hyper_39_125_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_125_chunk p_30 (cost=0.29..70.28 rows=31 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
62. 0.020 0.020 ↓ 0.0 0 20

Index Scan using _hyper_39_126_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_126_chunk p_31 (cost=0.29..65.21 rows=32 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
63. 0.020 0.020 ↓ 0.0 0 20

Index Scan using _hyper_39_127_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_127_chunk p_32 (cost=0.29..83.96 rows=38 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
64. 0.020 0.020 ↓ 0.0 0 20

Index Scan using _hyper_39_128_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_128_chunk p_33 (cost=0.29..79.01 rows=36 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
65. 0.040 0.040 ↓ 0.0 0 20

Index Scan using _hyper_39_129_chunk_production_new_date_taken_idx on _hyper_39_129_chunk p_34 (cost=0.28..13.10 rows=35 width=12) (actual time=0.002..0.002 rows=0 loops=20)

  • Index Cond: (date_taken = ped.date_taken)
  • Filter: (ped.fk_employee = fk_employee)
66. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_130_chunk p_35 (cost=3.05..7.60 rows=23 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
67. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_130_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..3.04 rows=23 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
68. 0.000 0.020 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_131_chunk p_36 (cost=4.66..27.89 rows=37 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
69. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_131_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.65 rows=37 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
70. 0.020 0.020 ↓ 0.0 0 20

Index Scan using _hyper_39_132_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_132_chunk p_37 (cost=0.28..30.66 rows=43 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
71. 0.000 0.060 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_133_chunk p_38 (cost=4.68..25.06 rows=39 width=12) (actual time=0.003..0.003 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
72. 0.060 0.060 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_133_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.67 rows=39 width=0) (actual time=0.003..0.003 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
73. 0.020 0.040 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_134_chunk p_39 (cost=4.47..16.09 rows=19 width=12) (actual time=0.002..0.002 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
74. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_134_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.47 rows=19 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
75. 0.000 0.040 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_135_chunk p_40 (cost=4.75..32.66 rows=46 width=12) (actual time=0.002..0.002 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
76. 0.040 0.040 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_135_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.74 rows=46 width=0) (actual time=0.002..0.002 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
77. 0.000 0.040 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_136_chunk p_41 (cost=4.79..39.56 rows=50 width=12) (actual time=0.002..0.002 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
78. 0.040 0.040 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_136_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.78 rows=50 width=0) (actual time=0.002..0.002 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
79. 0.040 0.040 ↓ 0.0 0 20

Index Scan using _hyper_39_137_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_137_chunk p_42 (cost=0.28..21.50 rows=46 width=12) (actual time=0.002..0.002 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
80. 0.020 0.020 ↓ 0.0 0 20

Index Scan using _hyper_39_138_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_138_chunk p_43 (cost=0.28..15.69 rows=19 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
81. 0.020 0.040 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_139_chunk p_44 (cost=4.46..20.61 rows=18 width=12) (actual time=0.002..0.002 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
82. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_139_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.46 rows=18 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
83. 0.020 0.040 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_140_chunk p_45 (cost=4.47..27.72 rows=19 width=12) (actual time=0.002..0.002 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
84. 0.020 0.020 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_140_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.47 rows=19 width=0) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
85. 0.040 0.040 ↓ 0.0 0 20

Index Scan using _hyper_39_141_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_141_chunk p_46 (cost=0.28..42.15 rows=23 width=12) (actual time=0.002..0.002 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
86. 0.040 0.040 ↓ 0.0 0 20

Index Scan using _hyper_39_142_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_142_chunk p_47 (cost=0.28..23.04 rows=16 width=12) (actual time=0.002..0.002 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
87. 0.020 0.020 ↓ 0.0 0 20

Index Scan using _hyper_39_143_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_143_chunk p_48 (cost=0.28..44.66 rows=26 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
88. 0.020 0.060 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_144_chunk p_49 (cost=4.62..50.53 rows=33 width=12) (actual time=0.003..0.003 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
89. 0.040 0.040 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_144_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.61 rows=33 width=0) (actual time=0.002..0.002 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
90. 0.040 0.040 ↓ 0.0 0 20

Index Scan using _hyper_39_145_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_145_chunk p_50 (cost=0.28..52.22 rows=30 width=12) (actual time=0.002..0.002 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
91. 0.000 0.040 ↓ 0.0 0 20

Bitmap Heap Scan on _hyper_39_146_chunk p_51 (cost=4.77..69.37 rows=48 width=12) (actual time=0.002..0.002 rows=0 loops=20)

  • Recheck Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
92. 0.040 0.040 ↓ 0.0 0 20

Bitmap Index Scan on _hyper_39_146_chunk_production_new_date_taken_fk_employee_idx (cost=0.00..4.76 rows=48 width=0) (actual time=0.002..0.002 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
93. 0.180 0.180 ↓ 0.0 0 20

Seq Scan on _hyper_39_147_chunk p_52 (cost=0.00..5.80 rows=12 width=12) (actual time=0.009..0.009 rows=0 loops=20)

  • Filter: ((ped.date_taken = date_taken) AND (ped.fk_employee = fk_employee))
  • Rows Removed by Filter: 120
94. 0.040 0.040 ↓ 0.0 0 20

Index Scan using _hyper_39_148_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_148_chunk p_53 (cost=0.28..54.47 rows=28 width=12) (actual time=0.002..0.002 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
95. 0.320 0.320 ↑ 1.4 34 20

Index Scan using _hyper_39_149_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_149_chunk p_54 (cost=0.28..67.15 rows=49 width=12) (actual time=0.003..0.016 rows=34 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
96. 0.040 0.040 ↓ 0.0 0 20

Index Scan using _hyper_39_150_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_150_chunk p_55 (cost=0.28..72.17 rows=45 width=12) (actual time=0.002..0.002 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
97. 0.020 0.020 ↓ 0.0 0 20

Index Scan using _hyper_39_151_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_151_chunk p_56 (cost=0.28..67.71 rows=51 width=12) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: ((date_taken = ped.date_taken) AND (fk_employee = ped.fk_employee))
98.          

CTE total_minutes_by_manufacturing_cell

99. 0.000 0.000 ↓ 0.0 0

GroupAggregate (cost=148.90..148.93 rows=1 width=16) (never executed)

  • Group Key: mo.fk_manufacturing_cell, p_57.date_taken
100. 0.000 0.000 ↓ 0.0 0

Sort (cost=148.90..148.91 rows=1 width=20) (never executed)

  • Sort Key: mo.fk_manufacturing_cell, p_57.date_taken
101. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=41.41..148.89 rows=1 width=20) (never executed)

102. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=41.26..148.72 rows=1 width=20) (never executed)

  • Hash Cond: (m.fk_operation = p_57.fk_operation)
103. 0.000 0.000 ↓ 0.0 0

Seq Scan on mcell_operation_choosen m (cost=0.00..93.69 rows=3,669 width=8) (never executed)

104. 0.000 0.000 ↓ 0.0 0

Hash (cost=41.25..41.25 rows=1 width=20) (never executed)

105. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.00..41.25 rows=1 width=20) (never executed)

106. 0.000 0.000 ↓ 0.0 0

CTE Scan on max_minutes_employees mme (cost=0.00..0.02 rows=1 width=16) (never executed)

107. 0.000 0.000 ↓ 0.0 0

Append (cost=0.00..41.21 rows=2 width=16) (never executed)

108. 0.000 0.000 ↓ 0.0 0

Seq Scan on production p_57 (cost=0.00..0.00 rows=1 width=16) (never executed)

  • Filter: ((fk_employee IS NOT NULL) AND (date_taken >= '2019-04-01'::date) AND (date_taken <= '2019-04-03'::date) AND ((type_special)::text <> 'bad_quality'::text) AND ((type_special)::text <> 'reprocess_quality'::text) AND ((type_special)::text <> 'reprocess_quality_audit'::text) AND (mme.date_taken = date_taken) AND (mme.fk_employee = fk_employee))
109. 0.000 0.000 ↓ 0.0 0

Index Scan using _hyper_39_149_chunk_production_new_date_taken_fk_employee_idx on _hyper_39_149_chunk p_58 (cost=0.28..41.21 rows=1 width=16) (never executed)

  • Index Cond: ((date_taken = mme.date_taken) AND (date_taken >= '2019-04-01'::date) AND (date_taken <= '2019-04-03'::date) AND (fk_employee = mme.fk_employee) AND (fk_employee IS NOT NULL))
  • Filter: (((type_special)::text <> 'bad_quality'::text) AND ((type_special)::text <> 'reprocess_quality'::text) AND ((type_special)::text <> 'reprocess_quality_audit'::text))
110. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_manufacturing_cell_operation on manufacturing_cell_operation mo (cost=0.15..0.17 rows=1 width=8) (never executed)

  • Index Cond: (id = m.fk_manufacturing_cell_operation)
111.          

CTE incentives_daily

112. 0.008 0.069 ↑ 8.0 10 1

Unique (cost=165.37..166.00 rows=80 width=12) (actual time=0.058..0.069 rows=10 loops=1)

113. 0.024 0.061 ↓ 1.4 115 1

Sort (cost=165.37..165.58 rows=84 width=12) (actual time=0.058..0.061 rows=115 loops=1)

  • Sort Key: production_incentives_by_mcell.fk_manufacturing_cell, production_incentives_by_mcell.date_taken
  • Sort Method: quicksort Memory: 30kB
114. 0.025 0.037 ↓ 1.4 115 1

Bitmap Heap Scan on production_incentives_by_mcell (cost=5.14..162.69 rows=84 width=12) (actual time=0.014..0.037 rows=115 loops=1)

  • Recheck Cond: ((date_taken >= '2019-04-01'::date) AND (date_taken <= '2019-04-03'::date))
  • Filter: (fk_domain = 1)
  • Heap Blocks: exact=14
115. 0.012 0.012 ↓ 1.4 115 1

Bitmap Index Scan on unique_production_incentives_by_mcell (cost=0.00..5.12 rows=84 width=0) (actual time=0.012..0.012 rows=115 loops=1)

  • Index Cond: ((date_taken >= '2019-04-01'::date) AND (date_taken <= '2019-04-03'::date))
116.          

CTE incentives_daily_total

117. 0.022 0.091 ↑ 8.0 10 1

HashAggregate (cost=2.40..3.20 rows=80 width=12) (actual time=0.074..0.091 rows=10 loops=1)

  • Group Key: incentives_daily.fk_manufacturing_cell, incentives_daily.date_taken
118. 0.069 0.069 ↑ 8.0 10 1

CTE Scan on incentives_daily (cost=0.00..1.60 rows=80 width=12) (actual time=0.058..0.069 rows=10 loops=1)

119.          

CTE incentives_hour

120. 0.024 0.119 ↑ 8.0 10 1

HashAggregate (cost=163.53..164.33 rows=80 width=12) (actual time=0.116..0.119 rows=10 loops=1)

  • Group Key: production_incentives_by_mcell_1.fk_manufacturing_cell, production_incentives_by_mcell_1.date_taken
121. 0.044 0.095 ↓ 1.4 115 1

Bitmap Heap Scan on production_incentives_by_mcell production_incentives_by_mcell_1 (cost=5.14..162.69 rows=84 width=12) (actual time=0.058..0.095 rows=115 loops=1)

  • Recheck Cond: ((date_taken >= '2019-04-01'::date) AND (date_taken <= '2019-04-03'::date))
  • Filter: (fk_domain = 1)
  • Heap Blocks: exact=14
122. 0.051 0.051 ↓ 1.4 115 1

Bitmap Index Scan on unique_production_incentives_by_mcell (cost=0.00..5.12 rows=84 width=0) (actual time=0.051..0.051 rows=115 loops=1)

  • Index Cond: ((date_taken >= '2019-04-01'::date) AND (date_taken <= '2019-04-03'::date))
123.          

CTE incentives_total

124. 0.026 0.261 ↑ 8.0 10 1

Hash Full Join (cost=2.80..5.21 rows=80 width=12) (actual time=0.205..0.261 rows=10 loops=1)

  • Hash Cond: ((incentives_daily_total.fk_manufacturing_cell = incentives_hour.fk_manufacturing_cell) AND (incentives_daily_total.date_taken = incentives_hour.date_taken))
125. 0.108 0.108 ↑ 8.0 10 1

CTE Scan on incentives_daily_total (cost=0.00..1.60 rows=80 width=12) (actual time=0.075..0.108 rows=10 loops=1)

126. 0.003 0.127 ↑ 8.0 10 1

Hash (cost=1.60..1.60 rows=80 width=12) (actual time=0.127..0.127 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
127. 0.124 0.124 ↑ 8.0 10 1

CTE Scan on incentives_hour (cost=0.00..1.60 rows=80 width=12) (actual time=0.117..0.124 rows=10 loops=1)

128.          

CTE incentive_day

129. 0.002 52.839 ↓ 0.0 0 1

GroupAggregate (cost=262.76..262.84 rows=1 width=77) (actual time=52.839..52.839 rows=0 loops=1)

  • Group Key: mo_1.fk_manufacturing_cell, p_59.fk_employee, incentives_total.incentives, e.name, e.last_name, mcell.name, t.minutes, p_59.date_taken
130.          

Initplan (forGroupAggregate)

131. 0.000 0.000 ↓ 0.0 0

CTE Scan on calculated_group_incentives_but_individual_with (cost=0.00..0.02 rows=1 width=32) (never executed)

132. 0.011 52.837 ↓ 0.0 0 1

Sort (cost=262.74..262.74 rows=1 width=55) (actual time=52.837..52.837 rows=0 loops=1)

  • Sort Key: mo_1.fk_manufacturing_cell, p_59.fk_employee, incentives_total.incentives, e.name, e.last_name, mcell.name, t.minutes, p_59.date_taken
  • Sort Method: quicksort Memory: 25kB
133. 0.001 52.826 ↓ 0.0 0 1

Nested Loop (cost=145.20..262.73 rows=1 width=55) (actual time=52.826..52.826 rows=0 loops=1)

  • Join Filter: ((p_59.date_taken = t.date_taken) AND (mo_1.fk_manufacturing_cell = t.fk_manufacturing_cell))
134. 0.000 52.825 ↓ 0.0 0 1

Nested Loop (cost=145.20..262.69 rows=1 width=63) (actual time=52.825..52.825 rows=0 loops=1)

135. 0.000 52.825 ↓ 0.0 0 1

Nested Loop (cost=145.06..262.49 rows=1 width=49) (actual time=52.825..52.825 rows=0 loops=1)

136. 0.427 52.825 ↓ 0.0 0 1

Nested Loop (cost=144.78..254.19 rows=1 width=44) (actual time=52.825..52.825 rows=0 loops=1)

  • Join Filter: ((incentives_total.date_taken = p_59.date_taken) AND (mme_1.fk_employee = p_59.fk_employee) AND (incentives_total.fk_manufacturing_cell = mo_1.fk_manufacturing_cell))
137. 0.036 4.998 ↓ 100.0 100 1

Hash Join (cost=0.03..1.94 rows=1 width=28) (actual time=4.902..4.998 rows=100 loops=1)

  • Hash Cond: (incentives_total.date_taken = mme_1.date_taken)
138. 0.270 0.270 ↑ 8.0 10 1

CTE Scan on incentives_total (cost=0.00..1.60 rows=80 width=12) (actual time=0.206..0.270 rows=10 loops=1)

139. 0.006 4.692 ↓ 20.0 20 1

Hash (cost=0.02..0.02 rows=1 width=16) (actual time=4.692..4.692 rows=20 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
140. 4.686 4.686 ↓ 20.0 20 1

CTE Scan on max_minutes_employees mme_1 (cost=0.00..0.02 rows=1 width=16) (actual time=4.597..4.686 rows=20 loops=1)

141. 0.000 47.400 ↓ 0.0 0 100

Nested Loop (cost=144.75..252.23 rows=1 width=16) (actual time=0.474..0.474 rows=0 loops=100)

142. 32.394 47.400 ↓ 0.0 0 100

Hash Join (cost=144.60..252.06 rows=1 width=16) (actual time=0.474..0.474 rows=0 loops=100)

  • Hash Cond: (m_1.fk_operation = p_59.fk_operation)
143. 14.800 14.800 ↑ 1.0 3,632 100

Seq Scan on mcell_operation_choosen m_1 (cost=0.00..93.69 rows=3,669 width=8) (actual time=0.001..0.148 rows=3,632 loops=100)

144. 0.000 0.206 ↓ 0.0 0 1

Hash (cost=144.59..144.59 rows=1 width=16) (actual time=0.206..0.206 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
145. 0.000 0.206 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.00..144.59 rows=1 width=16) (actual time=0.206..0.206 rows=0 loops=1)

  • Join Filter: ((p_59.date_taken >= '2019-04-01'::date) AND (p_59.date_taken <= '2019-04-03'::date) AND (p_59.fk_domain = 1) AND ((p_59.type_special)::text <> 'bad_quality'::text) AND ((p_59.type_special)::text <> 'reprocess_quality'::text) AND ((p_59.type_special)::text <> 'reprocess_quality_audit'::text) AND ((p_59.type_special)::text <> 'normal_without_efficiency'::text) AND (p_59.fk_downtimes = d.id))
  • Filter: (d.add_to_efficiency OR (d.id IS NULL))
146. 0.001 0.206 ↓ 0.0 0 1

Append (cost=0.00..143.04 rows=2 width=56) (actual time=0.206..0.206 rows=0 loops=1)

147. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on production p_59 (cost=0.00..0.00 rows=1 width=56) (actual time=0.003..0.003 rows=0 loops=1)

  • Filter: ((date_taken >= '2019-04-01'::date) AND (date_taken <= '2019-04-03'::date) AND ((type_special)::text <> 'bad_quality'::text) AND ((type_special)::text <> 'reprocess_quality'::text) AND ((type_special)::text <> 'reprocess_quality_audit'::text) AND ((type_special)::text <> 'normal_without_efficiency'::text) AND (fk_domain = 1))
148. 0.202 0.202 ↓ 0.0 0 1

Index Scan Backward using _hyper_39_149_chunk_production_new_date_taken_idx on _hyper_39_149_chunk p_60 (cost=0.28..143.04 rows=1 width=56) (actual time=0.202..0.202 rows=0 loops=1)

  • Index Cond: ((date_taken >= '2019-04-01'::date) AND (date_taken <= '2019-04-03'::date))
  • Filter: (((type_special)::text <> 'bad_quality'::text) AND ((type_special)::text <> 'reprocess_quality'::text) AND ((type_special)::text <> 'reprocess_quality_audit'::text) AND ((type_special)::text <> 'normal_without_efficiency'::text) AND (fk_domain = 1))
  • Rows Removed by Filter: 670
149. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..1.11 rows=7 width=5) (never executed)

150. 0.000 0.000 ↓ 0.0 0

Seq Scan on downtimes d (cost=0.00..1.07 rows=7 width=5) (never executed)

151. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_manufacturing_cell_operation on manufacturing_cell_operation mo_1 (cost=0.15..0.17 rows=1 width=8) (never executed)

  • Index Cond: (id = m_1.fk_manufacturing_cell_operation)
152. 0.000 0.000 ↓ 0.0 0

Index Scan using employee_pkey on employee e (cost=0.28..8.30 rows=1 width=13) (never executed)

  • Index Cond: (id = mme_1.fk_employee)
153. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_manufacturing_cell on manufacturing_cell mcell (cost=0.14..0.19 rows=1 width=14) (never executed)

  • Index Cond: (id = mo_1.fk_manufacturing_cell)
154. 0.000 0.000 ↓ 0.0 0

CTE Scan on total_minutes_by_manufacturing_cell t (cost=0.00..0.02 rows=1 width=16) (never executed)

Planning time : 26.873 ms