explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PYKe

Settings
# exclusive inclusive rows x rows loops node
1. 0.587 14.383 ↓ 52.5 105 1

Sort (cost=1,225.19..1,225.20 rows=2 width=3,127) (actual time=14.378..14.383 rows=105 loops=1)

  • Sort Key: menu_computed."sortMealType", menu_computed."dateMenu", menu_computed.id, menu_computed."sortDish", menu_computed."idDish", menu_computed."idMenuElement", menu_computed."sortMenuElement", allergen_info."idAllergen
  • Sort Method: quicksort Memory: 173kB
2.          

CTE site_prod_param

3. 0.007 0.007 ↑ 1.0 1 1

Seq Scan on "SiteProductionParam" (cost=0.00..1.24 rows=1 width=64) (actual time=0.004..0.007 rows=1 loops=1)

  • Filter: (("dateValid" && '[2020-09-07,2020-09-14)'::daterange) AND ("idSiteOwner" = 9))
  • Rows Removed by Filter: 15
4.          

CTE categorymenu_child

5. 0.024 0.069 ↑ 1.0 1 1

Hash Right Join (cost=6.43..8.02 rows=1 width=36) (actual time=0.062..0.069 rows=1 loops=1)

  • Hash Cond: (("RecipeVersion"."idTexture" = "CategoryMenu"."idTexture") AND ("RecipeVersion"."idSegment" = "CategoryMenu"."idSegment") AND ("RecipeVersion"."idDiet" = "CategoryMenu"."idDiet"))
6. 0.005 0.005 ↑ 1.0 33 1

Seq Scan on "RecipeVersion" (cost=0.00..1.33 rows=33 width=16) (actual time=0.003..0.005 rows=33 loops=1)

7. 0.004 0.040 ↑ 1.0 1 1

Hash (cost=6.41..6.41 rows=1 width=31) (actual time=0.040..0.040 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
8. 0.036 0.036 ↑ 1.0 1 1

Seq Scan on "CategoryMenu" (cost=0.00..6.41 rows=1 width=31) (actual time=0.009..0.036 rows=1 loops=1)

  • Filter: (("isActive" IS TRUE) AND (id = 102))
  • Rows Removed by Filter: 272
9.          

CTE categorymenu

10. 0.070 0.070 ↑ 1.0 1 1

CTE Scan on categorymenu_child (cost=0.00..0.02 rows=1 width=139) (actual time=0.064..0.070 rows=1 loops=1)

11.          

CTE categorymenuweek

12. 0.002 0.037 ↑ 6.0 1 1

Unique (cost=17.79..17.83 rows=6 width=10) (actual time=0.035..0.037 rows=1 loops=1)

13. 0.010 0.035 ↑ 1.0 6 1

Sort (cost=17.79..17.80 rows=6 width=10) (actual time=0.035..0.035 rows=6 loops=1)

  • Sort Key: "CategoryMenuWeek"."idCategoryMenu", "CategoryMenuWeek"."idMealType
  • Sort Method: quicksort Memory: 25kB
14. 0.002 0.025 ↑ 1.0 6 1

Nested Loop (cost=0.28..17.71 rows=6 width=10) (actual time=0.012..0.025 rows=6 loops=1)

15. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on categorymenu (cost=0.00..0.02 rows=1 width=6) (actual time=0.000..0.001 rows=1 loops=1)

16. 0.022 0.022 ↑ 1.0 6 1

Index Scan using "CategoryMenuWeek_idx" on "CategoryMenuWeek" (cost=0.28..17.63 rows=6 width=8) (actual time=0.010..0.022 rows=6 loops=1)

  • Index Cond: ("idCategoryMenu" = categorymenu.id)
17.          

CTE nutrition_guideline

18. 0.002 0.009 ↓ 0.0 0 1

Limit (cost=0.00..1.51 rows=1 width=14) (actual time=0.009..0.009 rows=0 loops=1)

19. 0.007 0.007 ↓ 0.0 0 1

Seq Scan on "NutritionGuideline_CategoryMenu" (cost=0.00..1.51 rows=1 width=14) (actual time=0.007..0.007 rows=0 loops=1)

  • Filter: ("idCategoryMenu" = 102)
  • Rows Removed by Filter: 41
20.          

CTE nutrition_guideline_item

21. 0.000 0.010 ↓ 0.0 0 1

Nested Loop (cost=0.00..191.56 rows=1 width=380) (actual time=0.010..0.010 rows=0 loops=1)

  • Join Filter: (nut_item."idNutrition" = "Nutrition".id)
22. 0.000 0.010 ↓ 0.0 0 1

Nested Loop (cost=0.00..190.11 rows=1 width=24) (actual time=0.010..0.010 rows=0 loops=1)

  • Join Filter: ((nutrition_guideline.id = nut_item."idNutritionGuideline") AND (nut_item.week >= (((('2020-09-07'::date - nutrition_guideline."dateStart") / 7) % (nutrition_guideline."nbWeeks")::integer) + 1)) AND (nut_item.week <= (((('2020-09-13'::date - nutrition_guideline."dateStart") / 7) % (nutrition_guideline."nbWeeks")::integer) + 1)))
23. 0.010 0.010 ↓ 0.0 0 1

CTE Scan on nutrition_guideline (cost=0.00..0.02 rows=1 width=14) (actual time=0.010..0.010 rows=0 loops=1)

24. 0.000 0.000 ↓ 0.0 0

Seq Scan on "NutritionGuidelineItem" nut_item (cost=0.00..188.56 rows=36 width=16) (never executed)

  • Filter: (((weekday)::double precision >= '1'::double precision) AND ((weekday)::double precision <= '7'::double precision))
25. 0.000 0.000 ↓ 0.0 0

Seq Scan on "Nutrition" (cost=0.00..1.20 rows=20 width=356) (never executed)

26.          

CTE menus_without_recipes

27. 0.040 0.656 ↓ 12.6 63 1

Nested Loop Left Join (cost=0.85..18.58 rows=5 width=583) (actual time=0.477..0.656 rows=63 loops=1)

28. 0.034 0.553 ↓ 12.6 63 1

Nested Loop Left Join (cost=0.71..17.67 rows=5 width=501) (actual time=0.444..0.553 rows=63 loops=1)

  • Join Filter: (("Menu"."idCategoryMenu" = nutrition_guideline_item."idCategoryMenu") AND ("Menu_Element"."idDish" = nutrition_guideline_item."idDish") AND ("Menu"."idMealType" = nutrition_guideline_item."idMealType") AND ("Menu_Element".sort = nutrition_guideline_item.sort) AND (date_part('isodow'::text, ("Menu"."dateMenu")::timestamp without time zone) = (nutrition_guideline_item.weekday)::double precision) AND ((((("Menu"."dateMenu" - nutrition_guideline_item."dateStart") / 7) % (nutrition_guideline_item."nbWeeks")::integer) + 1) = nutrition_guideline_item.week))
29. 0.023 0.519 ↓ 12.6 63 1

Nested Loop (cost=0.71..17.38 rows=5 width=145) (actual time=0.431..0.519 rows=63 loops=1)

30. 0.010 0.454 ↓ 7.0 7 1

Nested Loop Left Join (cost=0.42..8.71 rows=1 width=47) (actual time=0.416..0.454 rows=7 loops=1)

  • Join Filter: ("ClosedPeriod"."idSiteOwner" = categorymenu_1."idSiteOwner")
31. 0.008 0.094 ↓ 7.0 7 1

Nested Loop (cost=0.29..8.34 rows=1 width=43) (actual time=0.076..0.094 rows=7 loops=1)

32. 0.071 0.071 ↑ 1.0 1 1

CTE Scan on categorymenu categorymenu_1 (cost=0.00..0.02 rows=1 width=21) (actual time=0.065..0.071 rows=1 loops=1)

33. 0.015 0.015 ↓ 7.0 7 1

Index Scan using "Menu_UK" on "Menu" (cost=0.29..8.31 rows=1 width=26) (actual time=0.009..0.015 rows=7 loops=1)

  • Index Cond: (("idCategoryMenu" = categorymenu_1.id) AND ("dateMenu" >= '2020-09-07'::date) AND ("dateMenu" <= '2020-09-13'::date))
34. 0.350 0.350 ↓ 0.0 0 7

Index Only Scan using "ClosedPeriod_Unique_Constraint" on "ClosedPeriod" (cost=0.13..0.36 rows=1 width=36) (actual time=0.050..0.050 rows=0 loops=7)

  • Index Cond: ("dateValid" @> "Menu"."dateMenu")
  • Heap Fetches: 0
35. 0.042 0.042 ↓ 1.5 9 7

Index Scan using "Menu_Element_idMenu" on "Menu_Element" (cost=0.29..8.61 rows=6 width=102) (actual time=0.003..0.006 rows=9 loops=7)

  • Index Cond: ("idMenu" = "Menu".id)
36. 0.000 0.000 ↓ 0.0 0 63

CTE Scan on nutrition_guideline_item (cost=0.00..0.02 rows=1 width=376) (actual time=0.000..0.000 rows=0 loops=63)

37. 0.063 0.063 ↓ 0.0 0 63

Index Scan using "MenuElement_ManualProductionTimeLag_UK" on "MenuElement_ManualProductionTimeLag" (cost=0.14..0.16 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=63)

  • Index Cond: ("idMenuElement" = "Menu_Element".id)
38.          

CTE menus_without_false_element

39. 0.705 0.705 ↓ 31.5 63 1

CTE Scan on menus_without_recipes (cost=0.00..0.11 rows=2 width=583) (actual time=0.481..0.705 rows=63 loops=1)

  • Filter: ("idElementRecipe" > 1)
40.          

CTE menus_with_recipes

41. 0.079 1.208 ↓ 63.0 63 1

Nested Loop Left Join (cost=20.52..22.65 rows=1 width=605) (actual time=1.013..1.208 rows=63 loops=1)

  • Join Filter: ("Recipe_Lifetime"."idRecipe" = menu_element_with_recipe."idRecipeMenu")
42. 0.033 1.129 ↓ 63.0 63 1

Nested Loop Left Join (cost=20.52..21.62 rows=1 width=609) (actual time=1.008..1.129 rows=63 loops=1)

  • Join Filter: ("Recipe_ProductionWorkshop"."idRecipe" = menu_element_with_recipe."idRecipeMenu")
43. 0.059 1.033 ↓ 63.0 63 1

Hash Join (cost=20.52..20.57 rows=1 width=605) (actual time=0.995..1.033 rows=63 loops=1)

  • Hash Cond: ((menus_without_false_element."idCategoryMenuVersion" = menu_element_with_recipe."idCategoryMenuVersion") AND (menus_without_false_element."idElementRecipe" = menu_element_with_recipe."idElementRecipe"))
44. 0.489 0.489 ↓ 31.5 63 1

CTE Scan on menus_without_false_element (cost=0.00..0.04 rows=2 width=583) (actual time=0.482..0.489 rows=63 loops=1)

45. 0.006 0.485 ↓ 4.5 9 1

Hash (cost=20.48..20.48 rows=2 width=30) (actual time=0.485..0.485 rows=9 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
46. 0.003 0.479 ↓ 4.5 9 1

Subquery Scan on menu_element_with_recipe (cost=20.45..20.48 rows=2 width=30) (actual time=0.475..0.479 rows=9 loops=1)

47. 0.003 0.476 ↓ 4.5 9 1

Unique (cost=20.45..20.46 rows=2 width=38) (actual time=0.474..0.476 rows=9 loops=1)

48. 0.013 0.473 ↓ 4.5 9 1

Sort (cost=20.45..20.45 rows=2 width=38) (actual time=0.473..0.473 rows=9 loops=1)

  • Sort Key: element_with_potential_recipe."idCategoryMenuVersion", element_with_potential_recipe."idElementRecipe", (CASE WHEN (element_with_potential_recipe."idRecipeVersionToCheck" IS NOT NULL) THEN element_with_potential_recipe."idRecipeVersionToCheck" ELSE element_with_potential_recipe."idCategoryMenuVersion" END) DESC
  • Sort Method: quicksort Memory: 25kB
49. 0.005 0.460 ↓ 4.5 9 1

Subquery Scan on element_with_potential_recipe (cost=0.19..20.44 rows=2 width=38) (actual time=0.337..0.460 rows=9 loops=1)

  • Filter: ((element_with_potential_recipe."idCategoryMenuVersion" = CASE WHEN (element_with_potential_recipe."idRecipeVersionToCheck" IS NOT NULL) THEN element_with_potential_recipe."idRecipeVersionToCheck" ELSE element_with_potential_recipe."idCategoryMenuVersion" END) OR (CASE WHEN (element_with_potential_recipe."idRecipeVersionToCheck" IS NOT NULL) THEN element_with_potential_recipe."idRecipeVersionToCheck" ELSE element_with_potential_recipe."idCategoryMenuVersion" END = 1))
50. 0.011 0.455 ↑ 22.2 9 1

ProjectSet (cost=0.19..17.44 rows=200 width=30) (actual time=0.334..0.455 rows=9 loops=1)

51. 0.011 0.444 ↓ 4.5 9 1

Nested Loop Left Join (cost=0.19..16.43 rows=2 width=51) (actual time=0.328..0.444 rows=9 loops=1)

52. 0.007 0.280 ↓ 4.5 9 1

Unique (cost=0.05..0.07 rows=2 width=8) (actual time=0.269..0.280 rows=9 loops=1)

53. 0.027 0.273 ↓ 31.5 63 1

Sort (cost=0.05..0.06 rows=2 width=8) (actual time=0.269..0.273 rows=63 loops=1)

  • Sort Key: menus_without_false_element_1."idElementRecipe", menus_without_false_element_1."idCategoryMenuVersion
  • Sort Method: quicksort Memory: 27kB
54. 0.246 0.246 ↓ 31.5 63 1

CTE Scan on menus_without_false_element menus_without_false_element_1 (cost=0.00..0.04 rows=2 width=8) (actual time=0.002..0.246 rows=63 loops=1)

55. 0.153 0.153 ↑ 1.0 1 9

Index Scan using "Recipe_dif_idRecipeFamily_idElement_excl" on "Recipe" (cost=0.14..8.16 rows=1 width=47) (actual time=0.012..0.017 rows=1 loops=9)

  • Index Cond: ("idElement" = menus_without_false_element_1."idElementRecipe")
  • Filter: ("idRecipeVersions" && ARRAY[1, menus_without_false_element_1."idCategoryMenuVersion"])
  • Rows Removed by Filter: 0
56. 0.063 0.063 ↓ 0.0 0 63

Seq Scan on "Recipe_ProductionWorkshop" (cost=0.00..1.04 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=63)

  • Filter: ("idSiteOwner" = 9)
  • Rows Removed by Filter: 3
57. 0.000 0.000 ↓ 0.0 0 63

Seq Scan on "Recipe_Lifetime" (cost=0.00..1.02 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=63)

  • Filter: ("idSiteOwner" = 9)
  • Rows Removed by Filter: 2
58.          

CTE menu_with_production_time_lag

59. 0.049 1.342 ↓ 63.0 63 1

Hash Right Join (cost=0.04..1.23 rows=1 width=617) (actual time=1.319..1.342 rows=63 loops=1)

  • Hash Cond: (("ProductionTimeLagRule"."idProductionWorkshop" = menus_with_recipes."idProductionWorkshop") AND ("ProductionTimeLagRule"."idMealType" = menus_with_recipes."idMealType") AND (("ProductionTimeLagRule".weekday)::double precision = date_part('isodow'::text, (menus_with_recipes."dateMenu")::timestamp without time zone)) AND ("ProductionTimeLagRule"."idSiteOwner" = menus_with_recipes."idSiteOwner"))
60. 0.003 0.003 ↑ 1.0 6 1

Seq Scan on "ProductionTimeLagRule" (cost=0.00..1.06 rows=6 width=16) (actual time=0.002..0.003 rows=6 loops=1)

61. 0.039 1.290 ↓ 63.0 63 1

Hash (cost=0.02..0.02 rows=1 width=605) (actual time=1.290..1.290 rows=63 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 18kB
62. 1.251 1.251 ↓ 63.0 63 1

CTE Scan on menus_with_recipes (cost=0.00..0.02 rows=1 width=605) (actual time=1.015..1.251 rows=63 loops=1)

63.          

CTE site_with_parent

64. 0.002 0.240 ↓ 2.0 2 1

Nested Loop (cost=16.22..21.56 rows=1 width=16) (actual time=0.209..0.240 rows=2 loops=1)

65. 0.001 0.232 ↓ 2.0 2 1

Nested Loop (cost=16.08..21.21 rows=1 width=20) (actual time=0.203..0.232 rows=2 loops=1)

66. 0.036 0.219 ↓ 2.0 2 1

Hash Join (cost=15.93..20.87 rows=1 width=20) (actual time=0.192..0.219 rows=2 loops=1)

  • Hash Cond: (wished_site_parent_tree."idTree" = root."idTree")
  • Join Filter: ((wished_site_parent_tree."leftBorder" <= root."leftBorderFromSite") AND (wished_site_parent_tree."rightBorder" >= root."rightBorderFromSite") AND (wished_site_parent_tree.depth >= root.depth))
  • Rows Removed by Join Filter: 124
67. 0.012 0.012 ↑ 1.0 155 1

Seq Scan on "Site_Parent_Tree" wished_site_parent_tree (cost=0.00..2.55 rows=155 width=20) (actual time=0.005..0.012 rows=155 loops=1)

68. 0.001 0.171 ↑ 1.0 1 1

Hash (cost=15.92..15.92 rows=1 width=20) (actual time=0.171..0.171 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
69. 0.025 0.170 ↑ 1.0 1 1

Hash Join (cost=12.20..15.92 rows=1 width=20) (actual time=0.152..0.170 rows=1 loops=1)

  • Hash Cond: ((from_site_parent_tree."idSite" = root."idFromSite") AND (from_site_parent_tree."idTree" = root."idTreeFromSite"))
70. 0.011 0.011 ↑ 1.0 155 1

Seq Scan on "Site_Parent_Tree" from_site_parent_tree (cost=0.00..2.55 rows=155 width=6) (actual time=0.003..0.011 rows=155 loops=1)

71. 0.003 0.134 ↑ 1.0 1 1

Hash (cost=12.18..12.18 rows=1 width=18) (actual time=0.134..0.134 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
72. 0.001 0.131 ↑ 1.0 1 1

Subquery Scan on root (cost=12.17..12.18 rows=1 width=18) (actual time=0.131..0.131 rows=1 loops=1)

73. 0.001 0.130 ↑ 1.0 1 1

Limit (cost=12.17..12.17 rows=1 width=24) (actual time=0.130..0.130 rows=1 loops=1)

74. 0.008 0.129 ↑ 1.0 1 1

Sort (cost=12.17..12.17 rows=1 width=24) (actual time=0.129..0.129 rows=1 loops=1)

  • Sort Key: roots."idTree", roots."rightBorder
  • Sort Method: quicksort Memory: 25kB
75. 0.007 0.121 ↓ 2.0 2 1

Nested Loop (cost=8.32..12.16 rows=1 width=24) (actual time=0.076..0.121 rows=2 loops=1)

76. 0.042 0.100 ↓ 3.5 14 1

Hash Join (cost=8.17..11.13 rows=4 width=12) (actual time=0.067..0.100 rows=14 loops=1)

  • Hash Cond: (roots."idSite" = "Site".id)
  • Join Filter: (("Site".type = 1) OR (roots."idSite" = roots."idSiteParent"))
  • Rows Removed by Join Filter: 141
77. 0.012 0.012 ↑ 1.0 155 1

Seq Scan on "Site_Parent_Tree" roots (cost=0.00..2.55 rows=155 width=20) (actual time=0.004..0.012 rows=155 loops=1)

78. 0.020 0.046 ↑ 1.0 141 1

Hash (cost=6.41..6.41 rows=141 width=6) (actual time=0.046..0.046 rows=141 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 14kB
79. 0.026 0.026 ↑ 1.0 141 1

Seq Scan on "Site" (cost=0.00..6.41 rows=141 width=6) (actual time=0.003..0.026 rows=141 loops=1)

80. 0.014 0.014 ↓ 0.0 0 14

Index Scan using "Site_Parent_Tree_PK" on "Site_Parent_Tree" from_site_1 (cost=0.14..0.25 rows=1 width=14) (actual time=0.001..0.001 rows=0 loops=14)

  • Index Cond: (("idTree" = roots."idTree") AND ("idSite" = 9))
  • Filter: ((roots."leftBorder" <= "leftBorder") AND (roots."rightBorder" >= "rightBorder"))
  • Rows Removed by Filter: 0
81. 0.012 0.012 ↑ 1.0 1 2

Index Only Scan using "Site_PK" on "Site" wished_site (cost=0.14..0.34 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=2)

  • Index Cond: (id = wished_site_parent_tree."idSite")
  • Heap Fetches: 2
82. 0.006 0.006 ↑ 1.0 1 2

Index Only Scan using "Site_PK" on "Site" from_site (cost=0.14..0.34 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=2)

  • Index Cond: (id = from_site_parent_tree."idSite")
  • Heap Fetches: 2
83.          

CTE site_root

84. 0.015 0.015 ↑ 1.0 1 1

Seq Scan on "Site" "Site_1" (cost=0.00..6.77 rows=1 width=1) (actual time=0.010..0.015 rows=1 loops=1)

  • Filter: (id = 9)
  • Rows Removed by Filter: 140
85.          

CTE production_and_consumption_date

86. 0.000 0.026 ↑ 1.0 1 1

Limit (cost=0.03..0.04 rows=1 width=16) (actual time=0.026..0.026 rows=1 loops=1)

87. 0.019 0.026 ↑ 1.0 1 1

Aggregate (cost=0.03..0.04 rows=1 width=16) (actual time=0.026..0.026 rows=1 loops=1)

88. 0.007 0.007 ↓ 63.0 63 1

CTE Scan on menu_with_production_time_lag (cost=0.00..0.02 rows=1 width=8) (actual time=0.000..0.007 rows=63 loops=1)

89.          

CTE smartselection_rule

90. 0.002 0.297 ↓ 0.0 0 1

Append (cost=0.00..2.54 rows=2 width=184) (actual time=0.297..0.297 rows=0 loops=1)

91. 0.000 0.290 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1 (cost=0.00..1.34 rows=1 width=184) (actual time=0.290..0.290 rows=0 loops=1)

92. 0.007 0.290 ↓ 0.0 0 1

Nested Loop (cost=0.00..1.32 rows=1 width=176) (actual time=0.290..0.290 rows=0 loops=1)

  • Join Filter: (("SmartSelectionRule"."idSiteOwner" = site_with_parent."idSite") AND ((("SmartSelectionRule".status = 1) AND (site_with_parent."idSite" = 9)) OR (("SmartSelectionRule".status = 2) AND (site_with_parent."idSite" <> 9)) OR ("SmartSelectionRule".status = 3)))
  • Rows Removed by Join Filter: 16
93. 0.010 0.043 ↓ 8.0 8 1

Nested Loop (cost=0.00..1.27 rows=1 width=174) (actual time=0.035..0.043 rows=8 loops=1)

  • Join Filter: ("SmartSelectionRule"."dateValid" && daterange(COALESCE(production_and_consumption_date."fromConsumptionDate", '2020-09-07'::date), COALESCE(production_and_consumption_date."toConsumptionDate", '2020-09-13'::date), '[]'::text))
  • Rows Removed by Join Filter: 3
94. 0.027 0.027 ↑ 1.0 1 1

CTE Scan on production_and_consumption_date (cost=0.00..0.02 rows=1 width=8) (actual time=0.027..0.027 rows=1 loops=1)

95. 0.006 0.006 ↓ 3.7 11 1

Seq Scan on "SmartSelectionRule" (cost=0.00..1.21 rows=3 width=174) (actual time=0.004..0.006 rows=11 loops=1)

  • Filter: ((status = 1) OR (status = 2) OR (status = 3))
  • Rows Removed by Filter: 1
96. 0.240 0.240 ↓ 2.0 2 8

CTE Scan on site_with_parent (cost=0.00..0.02 rows=1 width=6) (actual time=0.026..0.030 rows=2 loops=8)

97. 0.000 0.005 ↓ 0.0 0 1

WindowAgg (cost=0.00..1.18 rows=1 width=184) (actual time=0.005..0.005 rows=0 loops=1)

98. 0.001 0.005 ↓ 0.0 0 1

Nested Loop (cost=0.00..1.14 rows=1 width=52) (actual time=0.004..0.005 rows=0 loops=1)

  • Join Filter: ("SitePreference"."dateValid" && daterange(COALESCE(production_and_consumption_date_1."fromConsumptionDate", '2020-09-07'::date), COALESCE(production_and_consumption_date_1."toConsumptionDate", '2020-09-13'::date), '[]'::text))
99. 0.004 0.004 ↓ 0.0 0 1

Seq Scan on "SitePreference" (cost=0.00..1.10 rows=1 width=52) (actual time=0.004..0.004 rows=0 loops=1)

  • Filter: (("idProduct" IS NOT NULL) AND ("idSiteOwner" = 9) AND (priority = 7))
  • Rows Removed by Filter: 7
100. 0.000 0.000 ↓ 0.0 0

CTE Scan on production_and_consumption_date production_and_consumption_date_1 (cost=0.00..0.02 rows=1 width=8) (never executed)

101.          

CTE distinct_category_menu

102. 0.000 0.000 ↓ 0.0 0

Unique (cost=0.03..0.04 rows=1 width=8) (never executed)

103. 0.000 0.000 ↓ 0.0 0

Sort (cost=0.03..0.04 rows=1 width=8) (never executed)

  • Sort Key: menu_with_production_time_lag_1."idCategoryMenu
104. 0.000 0.000 ↓ 0.0 0

CTE Scan on menu_with_production_time_lag menu_with_production_time_lag_1 (cost=0.00..0.02 rows=1 width=8) (never executed)

105.          

CTE category_menu_parents

106. 0.000 0.000 ↓ 0.0 0

CTE Scan on categorymenuparent categorymenuparent_1 (cost=68.66..70.28 rows=81 width=12) (never executed)

107.          

CTE categorymenuparent

108. 0.000 0.000 ↓ 0.0 0

Recursive Union (cost=0.18..68.66 rows=81 width=12) (never executed)

109. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.18..3.09 rows=1 width=12) (never executed)

110. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=0.03..2.76 rows=1 width=8) (never executed)

  • Hash Cond: ("CategoryMenu_Parent"."idCategoryMenu" = distinct_category_menu."idCategoryMenu")
111. 0.000 0.000 ↓ 0.0 0

Seq Scan on "CategoryMenu_Parent" (cost=0.00..2.25 rows=125 width=8) (never executed)

112. 0.000 0.000 ↓ 0.0 0

Hash (cost=0.02..0.02 rows=1 width=4) (never executed)

113. 0.000 0.000 ↓ 0.0 0

CTE Scan on distinct_category_menu (cost=0.00..0.02 rows=1 width=4) (never executed)

114. 0.000 0.000 ↓ 0.0 0

Index Scan using "CategoryMenu_PK" on "CategoryMenu" "CategoryMenu_1" (cost=0.15..0.33 rows=1 width=8) (never executed)

  • Index Cond: (id = "CategoryMenu_Parent"."idCategoryMenuParent")
  • Filter: "isActive
115. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.47..6.40 rows=8 width=12) (never executed)

116. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=0.33..3.14 rows=10 width=8) (never executed)

  • Hash Cond: ("CategoryMenu_Parent_1"."idCategoryMenu" = categorymenuparent."idCategoryMenuParent")
117. 0.000 0.000 ↓ 0.0 0

Seq Scan on "CategoryMenu_Parent" "CategoryMenu_Parent_1" (cost=0.00..2.25 rows=125 width=8) (never executed)

118. 0.000 0.000 ↓ 0.0 0

Hash (cost=0.20..0.20 rows=10 width=8) (never executed)

119. 0.000 0.000 ↓ 0.0 0

WorkTable Scan on categorymenuparent (cost=0.00..0.20 rows=10 width=8) (never executed)

120. 0.000 0.000 ↓ 0.0 0

Index Scan using "CategoryMenu_PK" on "CategoryMenu" "CategoryMenu_2" (cost=0.15..0.33 rows=1 width=8) (never executed)

  • Index Cond: (id = "CategoryMenu_Parent_1"."idCategoryMenuParent")
  • Filter: "isActive
121.          

CTE product

122. 0.176 0.781 ↓ 138.0 138 1

Nested Loop (cost=14.51..21.92 rows=1 width=282) (actual time=0.363..0.781 rows=138 loops=1)

123. 0.026 0.467 ↓ 138.0 138 1

Nested Loop (cost=14.36..21.43 rows=1 width=52) (actual time=0.350..0.467 rows=138 loops=1)

124. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on production_and_consumption_date production_and_consumption_date_2 (cost=0.00..0.02 rows=1 width=8) (actual time=0.000..0.001 rows=1 loops=1)

125. 0.103 0.440 ↓ 69.0 138 1

Bitmap Heap Scan on "SupplierProductAllowedFlat" (cost=14.36..21.39 rows=2 width=52) (actual time=0.346..0.440 rows=138 loops=1)

  • Recheck Cond: (("dateValid" && daterange(COALESCE(production_and_consumption_date_2."fromProductionDate", '2020-09-07'::date), COALESCE(production_and_consumption_date_2."toProductionDate", '2020-09-13'::date), '[]'::text)) AND ("allowedSites" @> '{9}'::integer[]))
  • Heap Blocks: exact=63
126. 0.006 0.337 ↓ 0.0 0 1

BitmapAnd (cost=14.36..14.36 rows=2 width=0) (actual time=0.337..0.337 rows=0 loops=1)

127. 0.303 0.303 ↓ 79.7 1,754 1

Bitmap Index Scan on "SupplierProductAllowedFlat_dateValid" (cost=0.00..4.31 rows=22 width=0) (actual time=0.303..0.303 rows=1,754 loops=1)

  • Index Cond: ("dateValid" && daterange(COALESCE(production_and_consumption_date_2."fromProductionDate", '2020-09-07'::date), COALESCE(production_and_consumption_date_2."toProductionDate", '2020-09-13'::date), '[]'::text))
128. 0.028 0.028 ↑ 1.0 232 1

Bitmap Index Scan on "SupplierProductAllowedFlat_allowedSites" (cost=0.00..9.74 rows=232 width=0) (actual time=0.028..0.028 rows=232 loops=1)

  • Index Cond: ("allowedSites" @> '{9}'::integer[])
129. 0.138 0.138 ↑ 1.0 1 138

Index Scan using "SupplierProductFlat_idSupplierProduct" on "SupplierProductFlat" (cost=0.14..0.47 rows=1 width=190) (actual time=0.001..0.001 rows=1 loops=138)

  • Index Cond: ("idSupplierProduct" = "SupplierProductAllowedFlat"."idSupplierProduct")
130.          

CTE stable_production_period

131. 0.017 1.171 ↓ 7.0 21 1

Unique (cost=0.12..0.19 rows=3 width=36) (actual time=1.017..1.171 rows=21 loops=1)

132. 0.135 1.154 ↓ 92.3 277 1

WindowAgg (cost=0.12..0.18 rows=3 width=36) (actual time=1.017..1.154 rows=277 loops=1)

133. 0.057 1.019 ↓ 92.3 277 1

Sort (cost=0.12..0.13 rows=3 width=4) (actual time=1.007..1.019 rows=277 loops=1)

  • Sort Key: (lower(product_1."dateValid"))
  • Sort Method: quicksort Memory: 37kB
134. 0.018 0.962 ↓ 92.3 277 1

Append (cost=0.00..0.10 rows=3 width=4) (actual time=0.367..0.962 rows=277 loops=1)

135. 0.921 0.921 ↓ 138.0 138 1

CTE Scan on product product_1 (cost=0.00..0.03 rows=1 width=4) (actual time=0.367..0.921 rows=138 loops=1)

  • Filter: (lower("dateValid") <> '-infinity'::date)
136. 0.023 0.023 ↓ 138.0 138 1

CTE Scan on product (cost=0.00..0.02 rows=1 width=4) (actual time=0.001..0.023 rows=138 loops=1)

137. 0.000 0.000 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=4) (actual time=0.000..0.000 rows=1 loops=1)

138.          

CTE stable_consumption_period

139. 0.000 0.014 ↑ 4.0 1 1

Unique (cost=0.19..0.28 rows=4 width=36) (actual time=0.014..0.014 rows=1 loops=1)

140. 0.005 0.014 ↑ 4.0 1 1

WindowAgg (cost=0.19..0.27 rows=4 width=36) (actual time=0.013..0.014 rows=1 loops=1)

141. 0.007 0.009 ↑ 4.0 1 1

Sort (cost=0.19..0.20 rows=4 width=4) (actual time=0.009..0.009 rows=1 loops=1)

  • Sort Key: (lower(smartselection_rule_1."dateValidRule"))
  • Sort Method: quicksort Memory: 25kB
142. 0.001 0.002 ↑ 4.0 1 1

Append (cost=0.00..0.15 rows=4 width=4) (actual time=0.002..0.002 rows=1 loops=1)

143. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on smartselection_rule smartselection_rule_1 (cost=0.00..0.05 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (lower("dateValidRule") <> '-infinity'::date)
144. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on smartselection_rule (cost=0.00..0.04 rows=2 width=4) (actual time=0.000..0.000 rows=0 loops=1)

145. 0.000 0.000 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=4) (actual time=0.000..0.000 rows=1 loops=1)

146.          

CTE recipe_only

147. 0.007 0.044 ↓ 9.0 9 1

Unique (cost=0.03..0.04 rows=1 width=4) (actual time=0.035..0.044 rows=9 loops=1)

148. 0.023 0.037 ↓ 63.0 63 1

Sort (cost=0.03..0.04 rows=1 width=4) (actual time=0.035..0.037 rows=63 loops=1)

  • Sort Key: menu_with_production_time_lag_2."idRecipeMenu
  • Sort Method: quicksort Memory: 27kB
149. 0.014 0.014 ↓ 63.0 63 1

CTE Scan on menu_with_production_time_lag menu_with_production_time_lag_2 (cost=0.00..0.02 rows=1 width=4) (actual time=0.001..0.014 rows=63 loops=1)

150.          

CTE recipe_component

151. 0.038 0.180 ↓ 6.8 27 1

WindowAgg (cost=15.48..15.59 rows=4 width=206) (actual time=0.155..0.180 rows=27 loops=1)

152. 0.027 0.142 ↓ 6.8 27 1

Sort (cost=15.48..15.49 rows=4 width=130) (actual time=0.140..0.142 rows=27 loops=1)

  • Sort Key: recipe_only."idRecipeMenu", "RecipeFlat"."idRecipeVersion", "RecipeFlat"."idSubRecipeOwner
  • Sort Method: quicksort Memory: 32kB
153. 0.024 0.115 ↓ 6.8 27 1

Nested Loop (cost=4.31..15.44 rows=4 width=130) (actual time=0.060..0.115 rows=27 loops=1)

154. 0.002 0.064 ↓ 9.0 9 1

Nested Loop (cost=0.00..0.05 rows=1 width=5) (actual time=0.048..0.064 rows=9 loops=1)

155. 0.016 0.016 ↑ 1.0 1 1

CTE Scan on site_root (cost=0.00..0.02 rows=1 width=1) (actual time=0.011..0.016 rows=1 loops=1)

156. 0.046 0.046 ↓ 9.0 9 1

CTE Scan on recipe_only (cost=0.00..0.02 rows=1 width=4) (actual time=0.036..0.046 rows=9 loops=1)

157. 0.018 0.027 ↑ 1.3 3 9

Bitmap Heap Scan on "RecipeFlat" (cost=4.31..15.35 rows=4 width=129) (actual time=0.003..0.003 rows=3 loops=9)

  • Recheck Cond: ("idRecipe" = recipe_only."idRecipeMenu")
  • Heap Blocks: exact=9
158. 0.009 0.009 ↑ 1.3 3 9

Bitmap Index Scan on "RecipeFlat_idRecipe" (cost=0.00..4.31 rows=4 width=0) (actual time=0.001..0.001 rows=3 loops=9)

  • Index Cond: ("idRecipe" = recipe_only."idRecipeMenu")
159.          

CTE menu_compressed

160. 0.021 1.650 ↓ 9.0 9 1

Unique (cost=0.26..0.28 rows=1 width=96) (actual time=1.626..1.650 rows=9 loops=1)

161. 0.122 1.629 ↓ 63.0 63 1

Sort (cost=0.26..0.26 rows=1 width=96) (actual time=1.626..1.629 rows=63 loops=1)

  • Sort Key: stable_consumption_period."dateStableConsumption", stable_production_period."dateStableProduction", menu_with_production_time_lag_3."idCategoryMenu", menu_with_production_time_lag_3."idMealType", menu_with_production_time_lag_3."idDish", menu_with_production_time_lag_3."idRecipeMenu
  • Sort Method: quicksort Memory: 33kB
162. 0.044 1.507 ↓ 63.0 63 1

Nested Loop (cost=0.00..0.25 rows=1 width=96) (actual time=1.130..1.507 rows=63 loops=1)

  • Join Filter: (stable_consumption_period."dateStableConsumption" @> menu_with_production_time_lag_3."dateConsumption")
163. 0.189 1.463 ↓ 63.0 63 1

Nested Loop (cost=0.00..0.12 rows=1 width=68) (actual time=1.115..1.463 rows=63 loops=1)

  • Join Filter: (stable_production_period."dateStableProduction" @> menu_with_production_time_lag_3."dateProduction")
  • Rows Removed by Join Filter: 1,260
164. 0.014 0.014 ↓ 63.0 63 1

CTE Scan on menu_with_production_time_lag menu_with_production_time_lag_3 (cost=0.00..0.02 rows=1 width=40) (actual time=0.001..0.014 rows=63 loops=1)

  • Filter: (NOT "isExcludedRecipe")
165. 1.260 1.260 ↓ 7.0 21 63

CTE Scan on stable_production_period (cost=0.00..0.06 rows=3 width=32) (actual time=0.016..0.020 rows=21 loops=63)

166. 0.000 0.000 ↑ 4.0 1 63

CTE Scan on stable_consumption_period (cost=0.00..0.08 rows=4 width=32) (actual time=0.000..0.000 rows=1 loops=63)

167.          

CTE menu_with_recipe_and_categorymenu

168. 0.005 1.753 ↓ 5.5 11 1

Unique (cost=0.18..0.21 rows=2 width=21) (actual time=1.748..1.753 rows=11 loops=1)

169. 0.012 1.748 ↓ 6.0 12 1

Sort (cost=0.18..0.18 rows=2 width=21) (actual time=1.747..1.748 rows=12 loops=1)

  • Sort Key: menu_compressed."idSiteOwner", menu_compressed."idRecipeMenu", menu_compressed."idGuest", menu_compressed."idMealType", menu_compressed."idCategoryMenu
  • Sort Method: quicksort Memory: 25kB
170. 0.001 1.736 ↓ 6.0 12 1

Append (cost=0.00..0.17 rows=2 width=21) (actual time=1.628..1.736 rows=12 loops=1)

171. 1.653 1.653 ↓ 9.0 9 1

CTE Scan on menu_compressed (cost=0.00..0.02 rows=1 width=21) (actual time=1.628..1.653 rows=9 loops=1)

172. 0.009 0.082 ↓ 3.0 3 1

Nested Loop (cost=0.00..0.13 rows=1 width=21) (actual time=0.015..0.082 rows=3 loops=1)

  • Join Filter: ((menu_compressed_1."idRecipeMenu" = recipe_component."idRecipeMenu") AND ((recipe_component."idRecipeVersionMainParent" = menu_compressed_1."idCategoryMenuVersion") OR (recipe_component."idRecipeVersionMainParent" = 1)))
  • Rows Removed by Join Filter: 24
173. 0.001 0.001 ↓ 9.0 9 1

CTE Scan on menu_compressed menu_compressed_1 (cost=0.00..0.02 rows=1 width=20) (actual time=0.000..0.001 rows=9 loops=1)

174. 0.072 0.072 ↓ 3.0 3 9

CTE Scan on recipe_component (cost=0.00..0.09 rows=1 width=13) (actual time=0.002..0.008 rows=3 loops=9)

  • Filter: (type = 3)
  • Rows Removed by Filter: 24
175.          

CTE sites_list_descendant_and_ancestor

176. 0.001 0.229 ↑ 5.6 10 1

Append (cost=10.86..51.09 rows=56 width=24) (actual time=0.098..0.229 rows=10 loops=1)

177. 0.002 0.117 ↑ 14.0 2 1

Nested Loop (cost=10.86..25.13 rows=28 width=24) (actual time=0.098..0.117 rows=2 loops=1)

178. 0.013 0.013 ↑ 1.0 1 1

Seq Scan on "Site" from_site_2 (cost=0.00..6.76 rows=1 width=4) (actual time=0.009..0.013 rows=1 loops=1)

  • Filter: (id = 9)
  • Rows Removed by Filter: 140
179. 0.022 0.102 ↑ 14.0 2 1

Hash Join (cost=10.86..18.08 rows=28 width=24) (actual time=0.087..0.102 rows=2 loops=1)

  • Hash Cond: (wished_site_1.id = wished_site_parent_tree_1."idSite")
180. 0.015 0.015 ↑ 1.0 141 1

Seq Scan on "Site" wished_site_1 (cost=0.00..6.41 rows=141 width=4) (actual time=0.002..0.015 rows=141 loops=1)

181. 0.003 0.065 ↑ 14.0 2 1

Hash (cost=10.51..10.51 rows=28 width=24) (actual time=0.065..0.065 rows=2 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
182. 0.048 0.062 ↑ 14.0 2 1

Nested Loop (cost=0.00..10.51 rows=28 width=24) (actual time=0.026..0.062 rows=2 loops=1)

  • Join Filter: ((wished_site_parent_tree_1."leftBorder" <= from_site_parent_tree_1."leftBorder") AND (wished_site_parent_tree_1."rightBorder" >= from_site_parent_tree_1."rightBorder"))
  • Rows Removed by Join Filter: 124
183. 0.014 0.014 ↑ 1.0 126 1

Seq Scan on "Site_Parent_Tree" wished_site_parent_tree_1 (cost=0.00..2.94 rows=126 width=20) (actual time=0.004..0.014 rows=126 loops=1)

  • Filter: ("idTree" = '1'::smallint)
  • Rows Removed by Filter: 29
184. 0.000 0.000 ↑ 2.0 1 126

Materialize (cost=0.00..3.33 rows=2 width=14) (actual time=0.000..0.000 rows=1 loops=126)

185. 0.014 0.014 ↑ 2.0 1 1

Seq Scan on "Site_Parent_Tree" from_site_parent_tree_1 (cost=0.00..3.32 rows=2 width=14) (actual time=0.007..0.014 rows=1 loops=1)

  • Filter: (("idTree" = '1'::smallint) AND ("idSite" = 9))
  • Rows Removed by Filter: 154
186. 0.002 0.111 ↑ 3.5 8 1

Nested Loop (cost=10.86..25.13 rows=28 width=24) (actual time=0.088..0.111 rows=8 loops=1)

187. 0.011 0.011 ↑ 1.0 1 1

Seq Scan on "Site" from_site_3 (cost=0.00..6.76 rows=1 width=4) (actual time=0.007..0.011 rows=1 loops=1)

  • Filter: (id = 9)
  • Rows Removed by Filter: 140
188. 0.021 0.098 ↑ 3.5 8 1

Hash Join (cost=10.86..18.08 rows=28 width=24) (actual time=0.080..0.098 rows=8 loops=1)

  • Hash Cond: (wished_site_2.id = wished_site_parent_tree_2."idSite")
189. 0.014 0.014 ↑ 1.0 141 1

Seq Scan on "Site" wished_site_2 (cost=0.00..6.41 rows=141 width=4) (actual time=0.002..0.014 rows=141 loops=1)

190. 0.004 0.063 ↑ 3.5 8 1

Hash (cost=10.51..10.51 rows=28 width=24) (actual time=0.063..0.063 rows=8 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
191. 0.045 0.059 ↑ 3.5 8 1

Nested Loop (cost=0.00..10.51 rows=28 width=24) (actual time=0.020..0.059 rows=8 loops=1)

  • Join Filter: ((wished_site_parent_tree_2."leftBorder" > from_site_parent_tree_2."leftBorder") AND (wished_site_parent_tree_2."rightBorder" < from_site_parent_tree_2."rightBorder"))
  • Rows Removed by Join Filter: 118
192. 0.014 0.014 ↑ 1.0 126 1

Seq Scan on "Site_Parent_Tree" wished_site_parent_tree_2 (cost=0.00..2.94 rows=126 width=20) (actual time=0.003..0.014 rows=126 loops=1)

  • Filter: ("idTree" = '1'::smallint)
  • Rows Removed by Filter: 29
193. 0.000 0.000 ↑ 2.0 1 126

Materialize (cost=0.00..3.33 rows=2 width=14) (actual time=0.000..0.000 rows=1 loops=126)

194. 0.011 0.011 ↑ 2.0 1 1

Seq Scan on "Site_Parent_Tree" from_site_parent_tree_2 (cost=0.00..3.32 rows=2 width=14) (actual time=0.005..0.011 rows=1 loops=1)

  • Filter: (("idTree" = '1'::smallint) AND ("idSite" = 9))
  • Rows Removed by Filter: 154
195.          

CTE menu_with_recipe_and_categorymenu_with_criterias

196. 0.018 0.182 ↓ 5.5 11 1

Hash Join (cost=16.46..17.81 rows=2 width=43) (actual time=0.044..0.182 rows=11 loops=1)

  • Hash Cond: (sites_list_descendant_and_ancestor."idSite" = "Recipe_1"."_idSiteOwner")
197. 0.135 0.135 ↑ 5.6 10 1

CTE Scan on sites_list_descendant_and_ancestor (cost=0.00..1.12 rows=56 width=14) (actual time=0.000..0.135 rows=10 loops=1)

198. 0.005 0.029 ↓ 5.5 11 1

Hash (cost=16.43..16.43 rows=2 width=33) (actual time=0.029..0.029 rows=11 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
199. 0.012 0.024 ↓ 5.5 11 1

Nested Loop (cost=0.15..16.43 rows=2 width=33) (actual time=0.009..0.024 rows=11 loops=1)

200. 0.001 0.001 ↓ 5.5 11 1

CTE Scan on menu_with_recipe_and_categorymenu (cost=0.00..0.04 rows=2 width=21) (actual time=0.000..0.001 rows=11 loops=1)

201. 0.011 0.011 ↑ 1.0 1 11

Index Scan using "Recipe_PK" on "Recipe" "Recipe_1" (cost=0.15..8.17 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=11)

  • Index Cond: (id = menu_with_recipe_and_categorymenu."idRecipe")
202.          

CTE smart_recipe_to_analyse

203. 0.003 0.013 ↓ 5.5 11 1

Unique (cost=0.05..0.08 rows=2 width=16) (actual time=0.009..0.013 rows=11 loops=1)

204. 0.008 0.010 ↓ 5.5 11 1

Sort (cost=0.05..0.06 rows=2 width=16) (actual time=0.009..0.010 rows=11 loops=1)

  • Sort Key: menu_with_recipe_and_categorymenu_with_criterias."idRecipe", menu_with_recipe_and_categorymenu_with_criterias."idMealType", menu_with_recipe_and_categorymenu_with_criterias."idGuest", menu_with_recipe_and_categorymenu_with_criterias."idRecipeFamilyRecipe", menu_with_recipe_and_categorymenu_with_criterias."idSiteOwner
  • Sort Method: quicksort Memory: 25kB
205. 0.002 0.002 ↓ 5.5 11 1

CTE Scan on menu_with_recipe_and_categorymenu_with_criterias (cost=0.00..0.04 rows=2 width=16) (actual time=0.001..0.002 rows=11 loops=1)

206.          

CTE smartbasisweight_flat_pre

207. 0.013 0.016 ↑ 22.2 36 1

ProjectSet (cost=0.00..5.16 rows=800 width=36) (actual time=0.005..0.016 rows=36 loops=1)

208. 0.003 0.003 ↑ 1.0 8 1

Seq Scan on "SmartBasisWeightRule" (cost=0.00..1.08 rows=8 width=92) (actual time=0.002..0.003 rows=8 loops=1)

209.          

CTE simplified_criteria

210. 0.004 0.022 ↑ 13.3 15 1

Unique (cost=54.58..60.58 rows=200 width=8) (actual time=0.016..0.022 rows=15 loops=1)

211. 0.014 0.018 ↑ 22.2 36 1

Sort (cost=54.58..56.58 rows=800 width=8) (actual time=0.016..0.018 rows=36 loops=1)

  • Sort Key: smartbasisweight_flat_pre."idSmartRule", smartbasisweight_flat_pre."idColumn
  • Sort Method: quicksort Memory: 26kB
212. 0.004 0.004 ↑ 22.2 36 1

CTE Scan on smartbasisweight_flat_pre (cost=0.00..16.00 rows=800 width=8) (actual time=0.000..0.004 rows=36 loops=1)

213.          

CTE smartbasisweight_flat

214. 0.006 0.235 ↑ 29.5 61 1

Append (cost=0.00..266.75 rows=1,800 width=36) (actual time=0.007..0.235 rows=61 loops=1)

215. 0.026 0.026 ↑ 22.2 36 1

CTE Scan on smartbasisweight_flat_pre smartbasisweight_flat_pre_1 (cost=0.00..16.00 rows=800 width=36) (actual time=0.007..0.026 rows=36 loops=1)

216. 0.002 0.059 ↑ 66.7 3 1

Unique (cost=44.35..46.35 rows=200 width=36) (actual time=0.057..0.059 rows=3 loops=1)

217. 0.008 0.057 ↑ 100.0 4 1

Sort (cost=44.35..45.35 rows=400 width=36) (actual time=0.057..0.057 rows=4 loops=1)

  • Sort Key: id_table."idSmartRule
  • Sort Method: quicksort Memory: 25kB
218. 0.018 0.049 ↑ 100.0 4 1

Hash Anti Join (cost=4.51..27.06 rows=400 width=36) (actual time=0.042..0.049 rows=4 loops=1)

  • Hash Cond: (id_table."idSmartRule" = guest_table."idSmartRule")
219. 0.003 0.003 ↑ 22.2 36 1

CTE Scan on smartbasisweight_flat_pre id_table (cost=0.00..16.00 rows=800 width=28) (actual time=0.000..0.003 rows=36 loops=1)

220. 0.003 0.028 ↓ 5.0 5 1

Hash (cost=4.50..4.50 rows=1 width=4) (actual time=0.028..0.028 rows=5 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
221. 0.025 0.025 ↓ 5.0 5 1

CTE Scan on simplified_criteria guest_table (cost=0.00..4.50 rows=1 width=4) (actual time=0.017..0.025 rows=5 loops=1)

  • Filter: ("idColumn" = 6)
  • Rows Removed by Filter: 10
222. 0.001 0.031 ↑ 50.0 4 1

Unique (cost=44.35..46.35 rows=200 width=36) (actual time=0.030..0.031 rows=4 loops=1)

223. 0.008 0.030 ↑ 80.0 5 1

Sort (cost=44.35..45.35 rows=400 width=36) (actual time=0.030..0.030 rows=5 loops=1)

  • Sort Key: id_table_1."idSmartRule
  • Sort Method: quicksort Memory: 25kB
224. 0.015 0.022 ↑ 80.0 5 1

Hash Anti Join (cost=4.51..27.06 rows=400 width=36) (actual time=0.015..0.022 rows=5 loops=1)

  • Hash Cond: (id_table_1."idSmartRule" = mealtype_table."idSmartRule")
225. 0.003 0.003 ↑ 22.2 36 1

CTE Scan on smartbasisweight_flat_pre id_table_1 (cost=0.00..16.00 rows=800 width=28) (actual time=0.000..0.003 rows=36 loops=1)

226. 0.002 0.004 ↓ 4.0 4 1

Hash (cost=4.50..4.50 rows=1 width=4) (actual time=0.004..0.004 rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
227. 0.002 0.002 ↓ 4.0 4 1

CTE Scan on simplified_criteria mealtype_table (cost=0.00..4.50 rows=1 width=4) (actual time=0.001..0.002 rows=4 loops=1)

  • Filter: ("idColumn" = 7)
  • Rows Removed by Filter: 11
228. 0.002 0.033 ↑ 40.0 5 1

Unique (cost=44.35..46.35 rows=200 width=36) (actual time=0.031..0.033 rows=5 loops=1)

229. 0.009 0.031 ↑ 44.4 9 1

Sort (cost=44.35..45.35 rows=400 width=36) (actual time=0.031..0.031 rows=9 loops=1)

  • Sort Key: id_table_2."idSmartRule
  • Sort Method: quicksort Memory: 25kB
230. 0.015 0.022 ↑ 44.4 9 1

Hash Anti Join (cost=4.51..27.06 rows=400 width=36) (actual time=0.019..0.022 rows=9 loops=1)

  • Hash Cond: (id_table_2."idSmartRule" = recipe_table."idSmartRule")
231. 0.003 0.003 ↑ 22.2 36 1

CTE Scan on smartbasisweight_flat_pre id_table_2 (cost=0.00..16.00 rows=800 width=28) (actual time=0.000..0.003 rows=36 loops=1)

232. 0.002 0.004 ↓ 3.0 3 1

Hash (cost=4.50..4.50 rows=1 width=4) (actual time=0.004..0.004 rows=3 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
233. 0.002 0.002 ↓ 3.0 3 1

CTE Scan on simplified_criteria recipe_table (cost=0.00..4.50 rows=1 width=4) (actual time=0.001..0.002 rows=3 loops=1)

  • Filter: ("idColumn" = 8)
  • Rows Removed by Filter: 12
234. 0.002 0.038 ↑ 33.3 6 1

Unique (cost=44.35..46.35 rows=200 width=36) (actual time=0.035..0.038 rows=6 loops=1)

235. 0.014 0.036 ↑ 13.3 30 1

Sort (cost=44.35..45.35 rows=400 width=36) (actual time=0.034..0.036 rows=30 loops=1)

  • Sort Key: id_table_3."idSmartRule
  • Sort Method: quicksort Memory: 27kB
236. 0.016 0.022 ↑ 13.3 30 1

Hash Anti Join (cost=4.51..27.06 rows=400 width=36) (actual time=0.014..0.022 rows=30 loops=1)

  • Hash Cond: (id_table_3."idSmartRule" = recipefamily_table."idSmartRule")
237. 0.003 0.003 ↑ 22.2 36 1

CTE Scan on smartbasisweight_flat_pre id_table_3 (cost=0.00..16.00 rows=800 width=28) (actual time=0.000..0.003 rows=36 loops=1)

238. 0.001 0.003 ↓ 2.0 2 1

Hash (cost=4.50..4.50 rows=1 width=4) (actual time=0.003..0.003 rows=2 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
239. 0.002 0.002 ↓ 2.0 2 1

CTE Scan on simplified_criteria recipefamily_table (cost=0.00..4.50 rows=1 width=4) (actual time=0.001..0.002 rows=2 loops=1)

  • Filter: ("idColumn" = 9)
  • Rows Removed by Filter: 13
240. 0.003 0.042 ↑ 28.6 7 1

Unique (cost=44.35..46.35 rows=200 width=36) (actual time=0.038..0.042 rows=7 loops=1)

241. 0.015 0.039 ↑ 12.5 32 1

Sort (cost=44.35..45.35 rows=400 width=36) (actual time=0.037..0.039 rows=32 loops=1)

  • Sort Key: id_table_4."idSmartRule
  • Sort Method: quicksort Memory: 27kB
242. 0.018 0.024 ↑ 12.5 32 1

Hash Anti Join (cost=4.51..27.06 rows=400 width=36) (actual time=0.016..0.024 rows=32 loops=1)

  • Hash Cond: (id_table_4."idSmartRule" = site_table."idSmartRule")
243. 0.003 0.003 ↑ 22.2 36 1

CTE Scan on smartbasisweight_flat_pre id_table_4 (cost=0.00..16.00 rows=800 width=28) (actual time=0.000..0.003 rows=36 loops=1)

244. 0.001 0.003 ↑ 1.0 1 1

Hash (cost=4.50..4.50 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
245. 0.002 0.002 ↑ 1.0 1 1

CTE Scan on simplified_criteria site_table (cost=0.00..4.50 rows=1 width=4) (actual time=0.001..0.002 rows=1 loops=1)

  • Filter: ("idColumn" = 25)
  • Rows Removed by Filter: 14
246.          

CTE smartbasisweight_flat_filtered

247. 0.049 0.638 ↓ 31.0 31 1

Unique (cost=62.15..62.17 rows=1 width=36) (actual time=0.576..0.638 rows=31 loops=1)

248. 0.171 0.589 ↓ 331.0 331 1

Sort (cost=62.15..62.16 rows=1 width=36) (actual time=0.576..0.589 rows=331 loops=1)

  • Sort Key: smartbasisweight_flat."idSmartRule", smartbasisweight_flat."idColumn", smartbasisweight_flat."idCriteria", smartbasisweight_flat."idSiteOwner", smartbasisweight_flat.variation, smartbasisweight_flat.type, smartbasisweight_flat."dateUpdated
  • Sort Method: quicksort Memory: 50kB
249. 0.098 0.418 ↓ 331.0 331 1

Nested Loop (cost=0.00..62.14 rows=1 width=36) (actual time=0.016..0.418 rows=331 loops=1)

  • Join Filter: (((smartbasisweight_flat."idColumn" = 6) AND ((smartbasisweight_flat."idCriteria" = smart_recipe_to_analyse."idGuest") OR (smartbasisweight_flat."idCriteria" IS NULL))) OR ((smartbasisweight_flat."idColumn" = 7) AND ((smartbasisweight_flat."idCriteria" = smart_recipe_to_analyse."idMealType") OR (smartbasisweight_flat."idCriteria" IS NULL))) OR ((smartbasisweight_flat."idColumn" = 8) AND ((smartbasisweight_flat."idCriteria" = smart_recipe_to_analyse."idRecipe") OR (smartbasisweight_flat."idCriteria" IS NULL))) OR ((smartbasisweight_flat."idColumn" = 9) AND ((smartbasisweight_flat."idCriteria" = smart_recipe_to_analyse."idRecipeFamilyRecipe") OR (smartbasisweight_flat."idCriteria" IS NULL))) OR ((smartbasisweight_flat."idColumn" = 25) AND ((smartbasisweight_flat."idCriteria" = smart_recipe_to_analyse."idSiteOwner") OR (smartbasisweight_flat."idCriteria" IS NULL))))
  • Rows Removed by Join Filter: 340
250. 0.001 0.001 ↓ 5.5 11 1

CTE Scan on smart_recipe_to_analyse (cost=0.00..0.04 rows=2 width=16) (actual time=0.000..0.001 rows=11 loops=1)

251. 0.319 0.319 ↓ 1.4 61 11

CTE Scan on smartbasisweight_flat (cost=0.00..58.50 rows=45 width=36) (actual time=0.001..0.029 rows=61 loops=11)

  • Filter: (("idColumn" = 6) OR ("idColumn" = 7) OR ("idColumn" = 8) OR ("idColumn" = 9) OR ("idColumn" = 25))
252.          

CTE constructed_smart_rules

253. 0.004 0.957 ↓ 2.0 2 1

Unique (cost=1.56..1.59 rows=1 width=46) (actual time=0.953..0.957 rows=2 loops=1)

254. 0.021 0.953 ↓ 10.0 10 1

Sort (cost=1.56..1.56 rows=1 width=46) (actual time=0.953..0.953 rows=10 loops=1)

  • Sort Key: ((id_table_5."idSmartRule" * '-1'::integer)), (COALESCE(guest_table_1."idCriteria", '-1'::integer)), (COALESCE(mealtype_table_1."idCriteria", 0)), (COALESCE(recipe_table_1."idCriteria", '-1'::integer)), (COALESCE(recipefamily_table_1."idCriteria", '-1'::integer)), (COALESCE(site_table_1."idCriteria", id_table_5."idSiteOwner")), id_table_5.variation, id_table_5.type, id_table_5."dateUpdated
  • Sort Method: quicksort Memory: 26kB
255. 0.010 0.932 ↓ 10.0 10 1

Nested Loop (cost=0.07..1.55 rows=1 width=46) (actual time=0.761..0.932 rows=10 loops=1)

  • Join Filter: (guest_table_1."idSmartRule" = recipefamily_table_1."idSmartRule")
  • Rows Removed by Join Filter: 74
256. 0.009 0.894 ↓ 14.0 14 1

Nested Loop (cost=0.07..1.51 rows=1 width=62) (actual time=0.756..0.894 rows=14 loops=1)

  • Join Filter: (guest_table_1."idSmartRule" = recipe_table_1."idSmartRule")
  • Rows Removed by Join Filter: 70
257. 0.011 0.857 ↓ 14.0 14 1

Nested Loop (cost=0.07..1.48 rows=1 width=54) (actual time=0.753..0.857 rows=14 loops=1)

  • Join Filter: (guest_table_1."idSmartRule" = mealtype_table_1."idSmartRule")
  • Rows Removed by Join Filter: 94
258. 0.013 0.810 ↓ 18.0 18 1

Nested Loop (cost=0.07..1.44 rows=1 width=46) (actual time=0.749..0.810 rows=18 loops=1)

  • Join Filter: (id_table_5."idSmartRule" = guest_table_1."idSmartRule")
  • Rows Removed by Join Filter: 120
259. 0.015 0.751 ↓ 23.0 23 1

Hash Join (cost=0.07..1.41 rows=1 width=38) (actual time=0.745..0.751 rows=23 loops=1)

  • Hash Cond: (sites_list_descendant_and_ancestor_1."idSite" = COALESCE(site_table_1."idCriteria", id_table_5."idSiteOwner"))
260. 0.001 0.001 ↑ 5.6 10 1

CTE Scan on sites_list_descendant_and_ancestor sites_list_descendant_and_ancestor_1 (cost=0.00..1.12 rows=56 width=6) (actual time=0.000..0.001 rows=10 loops=1)

261. 0.008 0.735 ↓ 27.0 27 1

Hash (cost=0.05..0.05 rows=1 width=36) (actual time=0.735..0.735 rows=27 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
262. 0.024 0.727 ↓ 27.0 27 1

Nested Loop (cost=0.00..0.05 rows=1 width=36) (actual time=0.588..0.727 rows=27 loops=1)

  • Join Filter: (id_table_5."idSmartRule" = site_table_1."idSmartRule")
  • Rows Removed by Join Filter: 190
263. 0.579 0.579 ↓ 31.0 31 1

CTE Scan on smartbasisweight_flat_filtered id_table_5 (cost=0.00..0.02 rows=1 width=28) (actual time=0.577..0.579 rows=31 loops=1)

264. 0.124 0.124 ↓ 7.0 7 31

CTE Scan on smartbasisweight_flat_filtered site_table_1 (cost=0.00..0.02 rows=1 width=8) (actual time=0.001..0.004 rows=7 loops=31)

  • Filter: ("idColumn" = 25)
  • Rows Removed by Filter: 24
265. 0.046 0.046 ↓ 6.0 6 23

CTE Scan on smartbasisweight_flat_filtered guest_table_1 (cost=0.00..0.02 rows=1 width=8) (actual time=0.000..0.002 rows=6 loops=23)

  • Filter: ("idColumn" = 6)
  • Rows Removed by Filter: 25
266. 0.036 0.036 ↓ 6.0 6 18

CTE Scan on smartbasisweight_flat_filtered mealtype_table_1 (cost=0.00..0.02 rows=1 width=8) (actual time=0.000..0.002 rows=6 loops=18)

  • Filter: ("idColumn" = 7)
  • Rows Removed by Filter: 25
267. 0.028 0.028 ↓ 6.0 6 14

CTE Scan on smartbasisweight_flat_filtered recipe_table_1 (cost=0.00..0.02 rows=1 width=8) (actual time=0.000..0.002 rows=6 loops=14)

  • Filter: ("idColumn" = 8)
  • Rows Removed by Filter: 25
268. 0.028 0.028 ↓ 6.0 6 14

CTE Scan on smartbasisweight_flat_filtered recipefamily_table_1 (cost=0.00..0.02 rows=1 width=8) (actual time=0.000..0.002 rows=6 loops=14)

  • Filter: ("idColumn" = 9)
  • Rows Removed by Filter: 25
269.          

CTE smart_full

270. 0.001 1.025 ↑ 1.0 2 1

Append (cost=3.95..4.02 rows=2 width=46) (actual time=1.019..1.025 rows=2 loops=1)

271. 0.001 0.065 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1_1 (cost=3.95..3.98 rows=1 width=46) (actual time=0.065..0.065 rows=0 loops=1)

272. 0.000 0.064 ↓ 0.0 0 1

Unique (cost=3.95..3.96 rows=1 width=39) (actual time=0.064..0.064 rows=0 loops=1)

273. 0.004 0.064 ↓ 0.0 0 1

Sort (cost=3.95..3.95 rows=1 width=39) (actual time=0.064..0.064 rows=0 loops=1)

  • Sort Key: "BasisWeight"."idMealType", "BasisWeight"."idRecipe", "BasisWeight"."idGuest", "BasisWeight"."idSite
  • Sort Method: quicksort Memory: 25kB
274. 0.012 0.060 ↓ 0.0 0 1

Hash Join (cost=2.60..3.94 rows=1 width=39) (actual time=0.060..0.060 rows=0 loops=1)

  • Hash Cond: (sites_list_descendant_and_ancestor_2."idSite" = "BasisWeight"."idSite")
275. 0.000 0.000 ↑ 56.0 1 1

CTE Scan on sites_list_descendant_and_ancestor sites_list_descendant_and_ancestor_2 (cost=0.00..1.12 rows=56 width=6) (actual time=0.000..0.000 rows=1 loops=1)

276. 0.000 0.048 ↓ 0.0 0 1

Hash (cost=2.58..2.58 rows=1 width=21) (actual time=0.048..0.048 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
277. 0.020 0.048 ↓ 0.0 0 1

Hash Join (cost=0.07..2.58 rows=1 width=21) (actual time=0.048..0.048 rows=0 loops=1)

  • Hash Cond: ("BasisWeight"."idRecipe" = smart_recipe_to_analyse_1."idRecipe")
  • Join Filter: (((smart_recipe_to_analyse_1."idGuest" = "BasisWeight"."idGuest") OR ("BasisWeight"."idGuest" = '-1'::integer)) AND ((smart_recipe_to_analyse_1."idMealType" = "BasisWeight"."idMealType") OR ("BasisWeight"."idMealType" = 0)))
  • Rows Removed by Join Filter: 3
278. 0.009 0.009 ↑ 1.0 106 1

Seq Scan on "BasisWeight" (cost=0.00..2.06 rows=106 width=21) (actual time=0.004..0.009 rows=106 loops=1)

279. 0.004 0.019 ↓ 5.5 11 1

Hash (cost=0.04..0.04 rows=2 width=8) (actual time=0.019..0.019 rows=11 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
280. 0.015 0.015 ↓ 5.5 11 1

CTE Scan on smart_recipe_to_analyse smart_recipe_to_analyse_1 (cost=0.00..0.04 rows=2 width=8) (actual time=0.010..0.015 rows=11 loops=1)

281. 0.959 0.959 ↓ 2.0 2 1

CTE Scan on constructed_smart_rules (cost=0.00..0.02 rows=1 width=46) (actual time=0.954..0.959 rows=2 loops=1)

282.          

CTE smart_fix_conflict

283. 0.001 1.046 ↑ 1.0 2 1

Unique (cost=0.05..0.08 rows=2 width=46) (actual time=1.045..1.046 rows=2 loops=1)

284. 0.019 1.045 ↑ 1.0 2 1

Sort (cost=0.05..0.06 rows=2 width=46) (actual time=1.045..1.045 rows=2 loops=1)

  • Sort Key: smart_full."idRecipe", smart_full."idGuest", smart_full."idMealType", smart_full."idRecipeFamily", smart_full."idSiteOwner", smart_full."dateUpdated" DESC
  • Sort Method: quicksort Memory: 25kB
285. 1.026 1.026 ↑ 1.0 2 1

CTE Scan on smart_full (cost=0.00..0.04 rows=2 width=46) (actual time=1.019..1.026 rows=2 loops=1)

286.          

CTE recipe_basisweight_for_site

287. 1.048 1.048 ↑ 1.0 2 1

CTE Scan on smart_fix_conflict (cost=0.00..0.04 rows=2 width=34) (actual time=1.046..1.048 rows=2 loops=1)

288.          

CTE basisweight_with_site

289. 0.013 1.070 ↑ 1.0 2 1

Hash Join (cost=0.07..1.42 rows=2 width=42) (actual time=1.067..1.070 rows=2 loops=1)

  • Hash Cond: (site."idSite" = recipe_basisweight_for_site."idSite")
290. 0.001 0.001 ↑ 5.6 10 1

CTE Scan on sites_list_descendant_and_ancestor site (cost=0.00..1.12 rows=56 width=14) (actual time=0.000..0.001 rows=10 loops=1)

291. 0.006 1.056 ↑ 1.0 2 1

Hash (cost=0.04..0.04 rows=2 width=32) (actual time=1.056..1.056 rows=2 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
292. 1.050 1.050 ↑ 1.0 2 1

CTE Scan on recipe_basisweight_for_site (cost=0.00..0.04 rows=2 width=32) (actual time=1.047..1.050 rows=2 loops=1)

293.          

CTE basisweight_recipe_with_site

294. 0.015 0.308 ↓ 11.0 11 1

Hash Join (cost=0.07..1.43 rows=1 width=72) (actual time=0.303..0.308 rows=11 loops=1)

  • Hash Cond: (sites_list_descendant_and_ancestor_3."idSite" = menu_with_recipe_and_categorymenu_with_criterias_1."idSiteOwner")
  • Join Filter: ((sites_list_descendant_and_ancestor_3.depth >= menu_with_recipe_and_categorymenu_with_criterias_1."depthRecipe") AND (sites_list_descendant_and_ancestor_3."leftBorder" >= menu_with_recipe_and_categorymenu_with_criterias_1."leftBorderRecipe") AND (sites_list_descendant_and_ancestor_3."rightBorder" <= menu_with_recipe_and_categorymenu_with_criterias_1."rightBorderRecipe"))
295. 0.100 0.100 ↑ 5.6 10 1

CTE Scan on sites_list_descendant_and_ancestor sites_list_descendant_and_ancestor_3 (cost=0.00..1.12 rows=56 width=14) (actual time=0.099..0.100 rows=10 loops=1)

296. 0.004 0.193 ↓ 5.5 11 1

Hash (cost=0.04..0.04 rows=2 width=62) (actual time=0.193..0.193 rows=11 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
297. 0.189 0.189 ↓ 5.5 11 1

CTE Scan on menu_with_recipe_and_categorymenu_with_criterias menu_with_recipe_and_categorymenu_with_criterias_1 (cost=0.00..0.04 rows=2 width=62) (actual time=0.046..0.189 rows=11 loops=1)

298.          

CTE fast_recipe_with_basisweight

299. 0.003 1.452 ↑ 1.3 12 1

Append (cost=0.00..2.24 rows=16 width=62) (actual time=1.405..1.452 rows=12 loops=1)

300. 0.002 1.393 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.15 rows=1 width=62) (actual time=1.393..1.393 rows=0 loops=1)

  • Join Filter: ((basisweight_recipe_with_site.depth >= basisweight_with_site.depth) AND (basisweight_recipe_with_site."leftBorder" >= basisweight_with_site."leftBorder") AND (basisweight_recipe_with_site."rightBorder" <= basisweight_with_site."rightBorder") AND (basisweight_with_site.depth >= basisweight_recipe_with_site."depthRecipe") AND (basisweight_with_site."leftBorder" >= basisweight_recipe_with_site."leftBorderRecipe") AND (basisweight_with_site."rightBorder" <= basisweight_recipe_with_site."rightBorderRecipe") AND (basisweight_with_site."idGuest" = basisweight_recipe_with_site."idGuest") AND (basisweight_with_site."idRecipe" = basisweight_recipe_with_site."idRecipe") AND (basisweight_with_site."idMealType" = basisweight_recipe_with_site."idMealType") AND (basisweight_with_site."idRecipeFamily" = basisweight_recipe_with_site."idRecipeFamilyRecipe"))
  • Rows Removed by Join Filter: 22
301. 0.313 0.313 ↓ 11.0 11 1

CTE Scan on basisweight_recipe_with_site (cost=0.00..0.02 rows=1 width=68) (actual time=0.305..0.313 rows=11 loops=1)

302. 1.078 1.078 ↑ 1.0 2 11

CTE Scan on basisweight_with_site (cost=0.00..0.04 rows=2 width=38) (actual time=0.097..0.098 rows=2 loops=11)

303. 0.012 0.015 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.12 rows=1 width=62) (actual time=0.011..0.015 rows=1 loops=1)

  • Join Filter: ((basisweight_recipe_with_site_1.depth >= basisweight_with_site_1.depth) AND (basisweight_recipe_with_site_1."leftBorder" >= basisweight_with_site_1."leftBorder") AND (basisweight_recipe_with_site_1."rightBorder" <= basisweight_with_site_1."rightBorder") AND (basisweight_with_site_1.depth >= basisweight_recipe_with_site_1."depthRecipe") AND (basisweight_with_site_1."leftBorder" >= basisweight_recipe_with_site_1."leftBorderRecipe") AND (basisweight_with_site_1."rightBorder" <= basisweight_recipe_with_site_1."rightBorderRecipe") AND (basisweight_with_site_1."idGuest" = basisweight_recipe_with_site_1."idGuest") AND (basisweight_with_site_1."idRecipe" = basisweight_recipe_with_site_1."idRecipe") AND (basisweight_with_site_1."idMealType" = basisweight_recipe_with_site_1."idMealType"))
  • Rows Removed by Join Filter: 21
304. 0.001 0.001 ↓ 2.0 2 1

CTE Scan on basisweight_with_site basisweight_with_site_1 (cost=0.00..0.04 rows=1 width=38) (actual time=0.000..0.001 rows=2 loops=1)

  • Filter: ("idRecipeFamily" = '-1'::integer)
305. 0.002 0.002 ↓ 11.0 11 2

CTE Scan on basisweight_recipe_with_site basisweight_recipe_with_site_1 (cost=0.00..0.02 rows=1 width=64) (actual time=0.000..0.001 rows=11 loops=2)

306. 0.002 0.004 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.12 rows=1 width=62) (actual time=0.004..0.004 rows=0 loops=1)

  • Join Filter: ((basisweight_recipe_with_site_2.depth >= basisweight_with_site_2.depth) AND (basisweight_recipe_with_site_2."leftBorder" >= basisweight_with_site_2."leftBorder") AND (basisweight_recipe_with_site_2."rightBorder" <= basisweight_with_site_2."rightBorder") AND (basisweight_with_site_2.depth >= basisweight_recipe_with_site_2."depthRecipe") AND (basisweight_with_site_2."leftBorder" >= basisweight_recipe_with_site_2."leftBorderRecipe") AND (basisweight_with_site_2."rightBorder" <= basisweight_recipe_with_site_2."rightBorderRecipe") AND (basisweight_with_site_2."idGuest" = basisweight_recipe_with_site_2."idGuest") AND (basisweight_with_site_2."idRecipe" = basisweight_recipe_with_site_2."idRecipe") AND (basisweight_with_site_2."idRecipeFamily" = basisweight_recipe_with_site_2."idRecipeFamilyRecipe"))
  • Rows Removed by Join Filter: 11
307. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on basisweight_with_site basisweight_with_site_2 (cost=0.00..0.04 rows=1 width=38) (actual time=0.000..0.001 rows=1 loops=1)

  • Filter: ("idMealType" = 0)
  • Rows Removed by Filter: 1
308. 0.001 0.001 ↓ 11.0 11 1

CTE Scan on basisweight_recipe_with_site basisweight_recipe_with_site_2 (cost=0.00..0.02 rows=1 width=68) (actual time=0.000..0.001 rows=11 loops=1)

309. 0.002 0.004 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.12 rows=1 width=62) (actual time=0.004..0.004 rows=0 loops=1)

  • Join Filter: ((basisweight_recipe_with_site_3.depth >= basisweight_with_site_3.depth) AND (basisweight_recipe_with_site_3."leftBorder" >= basisweight_with_site_3."leftBorder") AND (basisweight_recipe_with_site_3."rightBorder" <= basisweight_with_site_3."rightBorder") AND (basisweight_with_site_3.depth >= basisweight_recipe_with_site_3."depthRecipe") AND (basisweight_with_site_3."leftBorder" >= basisweight_recipe_with_site_3."leftBorderRecipe") AND (basisweight_with_site_3."rightBorder" <= basisweight_recipe_with_site_3."rightBorderRecipe") AND (basisweight_with_site_3."idGuest" = basisweight_recipe_with_site_3."idGuest") AND (basisweight_with_site_3."idRecipe" = basisweight_recipe_with_site_3."idRecipe"))
  • Rows Removed by Join Filter: 11
310. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on basisweight_with_site basisweight_with_site_3 (cost=0.00..0.05 rows=1 width=38) (actual time=0.001..0.001 rows=1 loops=1)

  • Filter: (("idMealType" = 0) AND ("idRecipeFamily" = '-1'::integer))
  • Rows Removed by Filter: 1
311. 0.001 0.001 ↓ 11.0 11 1

CTE Scan on basisweight_recipe_with_site basisweight_recipe_with_site_3 (cost=0.00..0.02 rows=1 width=64) (actual time=0.000..0.001 rows=11 loops=1)

312. 0.004 0.005 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.12 rows=1 width=62) (actual time=0.005..0.005 rows=0 loops=1)

  • Join Filter: ((basisweight_recipe_with_site_4.depth >= basisweight_with_site_4.depth) AND (basisweight_recipe_with_site_4."leftBorder" >= basisweight_with_site_4."leftBorder") AND (basisweight_recipe_with_site_4."rightBorder" <= basisweight_with_site_4."rightBorder") AND (basisweight_with_site_4.depth >= basisweight_recipe_with_site_4."depthRecipe") AND (basisweight_with_site_4."leftBorder" >= basisweight_recipe_with_site_4."leftBorderRecipe") AND (basisweight_with_site_4."rightBorder" <= basisweight_recipe_with_site_4."rightBorderRecipe") AND (basisweight_with_site_4."idGuest" = basisweight_recipe_with_site_4."idGuest") AND (basisweight_with_site_4."idMealType" = basisweight_recipe_with_site_4."idMealType") AND (basisweight_with_site_4."idRecipeFamily" = basisweight_recipe_with_site_4."idRecipeFamilyRecipe"))
  • Rows Removed by Join Filter: 11
313. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on basisweight_with_site basisweight_with_site_4 (cost=0.00..0.04 rows=1 width=38) (actual time=0.000..0.000 rows=1 loops=1)

  • Filter: ("idRecipe" = '-1'::integer)
  • Rows Removed by Filter: 1
314. 0.001 0.001 ↓ 11.0 11 1

CTE Scan on basisweight_recipe_with_site basisweight_recipe_with_site_4 (cost=0.00..0.02 rows=1 width=68) (actual time=0.000..0.001 rows=11 loops=1)

315. 0.003 0.005 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.12 rows=1 width=62) (actual time=0.005..0.005 rows=0 loops=1)

  • Join Filter: ((basisweight_recipe_with_site_5.depth >= basisweight_with_site_5.depth) AND (basisweight_recipe_with_site_5."leftBorder" >= basisweight_with_site_5."leftBorder") AND (basisweight_recipe_with_site_5."rightBorder" <= basisweight_with_site_5."rightBorder") AND (basisweight_with_site_5.depth >= basisweight_recipe_with_site_5."depthRecipe") AND (basisweight_with_site_5."leftBorder" >= basisweight_recipe_with_site_5."leftBorderRecipe") AND (basisweight_with_site_5."rightBorder" <= basisweight_recipe_with_site_5."rightBorderRecipe") AND (basisweight_with_site_5."idGuest" = basisweight_recipe_with_site_5."idGuest") AND (basisweight_with_site_5."idMealType" = basisweight_recipe_with_site_5."idMealType"))
  • Rows Removed by Join Filter: 11
316. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on basisweight_with_site basisweight_with_site_5 (cost=0.00..0.05 rows=1 width=38) (actual time=0.001..0.001 rows=1 loops=1)

  • Filter: (("idRecipe" = '-1'::integer) AND ("idRecipeFamily" = '-1'::integer))
  • Rows Removed by Filter: 1
317. 0.001 0.001 ↓ 11.0 11 1

CTE Scan on basisweight_recipe_with_site basisweight_recipe_with_site_5 (cost=0.00..0.02 rows=1 width=64) (actual time=0.000..0.001 rows=11 loops=1)

318. 0.002 0.004 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.12 rows=1 width=62) (actual time=0.004..0.004 rows=0 loops=1)

  • Join Filter: ((basisweight_recipe_with_site_6.depth >= basisweight_with_site_6.depth) AND (basisweight_recipe_with_site_6."leftBorder" >= basisweight_with_site_6."leftBorder") AND (basisweight_recipe_with_site_6."rightBorder" <= basisweight_with_site_6."rightBorder") AND (basisweight_with_site_6.depth >= basisweight_recipe_with_site_6."depthRecipe") AND (basisweight_with_site_6."leftBorder" >= basisweight_recipe_with_site_6."leftBorderRecipe") AND (basisweight_with_site_6."rightBorder" <= basisweight_recipe_with_site_6."rightBorderRecipe") AND (basisweight_with_site_6."idGuest" = basisweight_recipe_with_site_6."idGuest") AND (basisweight_with_site_6."idRecipeFamily" = basisweight_recipe_with_site_6."idRecipeFamilyRecipe"))
  • Rows Removed by Join Filter: 11
319. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on basisweight_with_site basisweight_with_site_6 (cost=0.00..0.05 rows=1 width=38) (actual time=0.001..0.001 rows=1 loops=1)

  • Filter: (("idRecipe" = '-1'::integer) AND ("idMealType" = 0))
  • Rows Removed by Filter: 1
320. 0.001 0.001 ↓ 11.0 11 1

CTE Scan on basisweight_recipe_with_site basisweight_recipe_with_site_6 (cost=0.00..0.02 rows=1 width=68) (actual time=0.000..0.001 rows=11 loops=1)

321. 0.009 0.011 ↓ 11.0 11 1

Nested Loop (cost=0.00..0.12 rows=1 width=62) (actual time=0.004..0.011 rows=11 loops=1)

  • Join Filter: ((basisweight_recipe_with_site_7.depth >= basisweight_with_site_7.depth) AND (basisweight_recipe_with_site_7."leftBorder" >= basisweight_with_site_7."leftBorder") AND (basisweight_recipe_with_site_7."rightBorder" <= basisweight_with_site_7."rightBorder") AND (basisweight_with_site_7.depth >= basisweight_recipe_with_site_7."depthRecipe") AND (basisweight_with_site_7."leftBorder" >= basisweight_recipe_with_site_7."leftBorderRecipe") AND (basisweight_with_site_7."rightBorder" <= basisweight_recipe_with_site_7."rightBorderRecipe") AND (basisweight_with_site_7."idGuest" = basisweight_recipe_with_site_7."idGuest"))
322. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on basisweight_with_site basisweight_with_site_7 (cost=0.00..0.06 rows=1 width=38) (actual time=0.001..0.001 rows=1 loops=1)

  • Filter: (("idRecipe" = '-1'::integer) AND ("idRecipeFamily" = '-1'::integer) AND ("idMealType" = 0))
  • Rows Removed by Filter: 1
323. 0.001 0.001 ↓ 11.0 11 1

CTE Scan on basisweight_recipe_with_site basisweight_recipe_with_site_7 (cost=0.00..0.02 rows=1 width=64) (actual time=0.000..0.001 rows=11 loops=1)

324. 0.000 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.12 rows=1 width=62) (actual time=0.001..0.001 rows=0 loops=1)

  • Join Filter: ((basisweight_recipe_with_site_8.depth >= basisweight_with_site_8.depth) AND (basisweight_recipe_with_site_8."leftBorder" >= basisweight_with_site_8."leftBorder") AND (basisweight_recipe_with_site_8."rightBorder" <= basisweight_with_site_8."rightBorder") AND (basisweight_with_site_8.depth >= basisweight_recipe_with_site_8."depthRecipe") AND (basisweight_with_site_8."leftBorder" >= basisweight_recipe_with_site_8."leftBorderRecipe") AND (basisweight_with_site_8."rightBorder" <= basisweight_recipe_with_site_8."rightBorderRecipe") AND (basisweight_with_site_8."idRecipe" = basisweight_recipe_with_site_8."idRecipe") AND (basisweight_with_site_8."idMealType" = basisweight_recipe_with_site_8."idMealType") AND (basisweight_with_site_8."idRecipeFamily" = basisweight_recipe_with_site_8."idRecipeFamilyRecipe"))
325. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on basisweight_with_site basisweight_with_site_8 (cost=0.00..0.04 rows=1 width=38) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: ("idGuest" = '-1'::integer)
  • Rows Removed by Filter: 2
326. 0.000 0.000 ↓ 0.0 0

CTE Scan on basisweight_recipe_with_site basisweight_recipe_with_site_8 (cost=0.00..0.02 rows=1 width=68) (never executed)

327. 0.000 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.12 rows=1 width=62) (actual time=0.001..0.001 rows=0 loops=1)

  • Join Filter: ((basisweight_recipe_with_site_9.depth >= basisweight_with_site_9.depth) AND (basisweight_recipe_with_site_9."leftBorder" >= basisweight_with_site_9."leftBorder") AND (basisweight_recipe_with_site_9."rightBorder" <= basisweight_with_site_9."rightBorder") AND (basisweight_with_site_9.depth >= basisweight_recipe_with_site_9."depthRecipe") AND (basisweight_with_site_9."leftBorder" >= basisweight_recipe_with_site_9."leftBorderRecipe") AND (basisweight_with_site_9."rightBorder" <= basisweight_recipe_with_site_9."rightBorderRecipe") AND (basisweight_with_site_9."idRecipe" = basisweight_recipe_with_site_9."idRecipe") AND (basisweight_with_site_9."idMealType" = basisweight_recipe_with_site_9."idMealType"))
328. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on basisweight_with_site basisweight_with_site_9 (cost=0.00..0.05 rows=1 width=38) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (("idGuest" = '-1'::integer) AND ("idRecipeFamily" = '-1'::integer))
  • Rows Removed by Filter: 2
329. 0.000 0.000 ↓ 0.0 0

CTE Scan on basisweight_recipe_with_site basisweight_recipe_with_site_9 (cost=0.00..0.02 rows=1 width=64) (never executed)

330. 0.001 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.12 rows=1 width=62) (actual time=0.001..0.001 rows=0 loops=1)

  • Join Filter: ((basisweight_recipe_with_site_10.depth >= basisweight_with_site_10.depth) AND (basisweight_recipe_with_site_10."leftBorder" >= basisweight_with_site_10."leftBorder") AND (basisweight_recipe_with_site_10."rightBorder" <= basisweight_with_site_10."rightBorder") AND (basisweight_with_site_10.depth >= basisweight_recipe_with_site_10."depthRecipe") AND (basisweight_with_site_10."leftBorder" >= basisweight_recipe_with_site_10."leftBorderRecipe") AND (basisweight_with_site_10."rightBorder" <= basisweight_recipe_with_site_10."rightBorderRecipe") AND (basisweight_with_site_10."idRecipe" = basisweight_recipe_with_site_10."idRecipe") AND (basisweight_with_site_10."idRecipeFamily" = basisweight_recipe_with_site_10."idRecipeFamilyRecipe"))
331. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on basisweight_with_site basisweight_with_site_10 (cost=0.00..0.05 rows=1 width=38) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (("idGuest" = '-1'::integer) AND ("idMealType" = 0))
  • Rows Removed by Filter: 2
332. 0.000 0.000 ↓ 0.0 0

CTE Scan on basisweight_recipe_with_site basisweight_recipe_with_site_10 (cost=0.00..0.02 rows=1 width=68) (never executed)

333. 0.000 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.12 rows=1 width=62) (actual time=0.001..0.001 rows=0 loops=1)

  • Join Filter: ((basisweight_recipe_with_site_11.depth >= basisweight_with_site_11.depth) AND (basisweight_recipe_with_site_11."leftBorder" >= basisweight_with_site_11."leftBorder") AND (basisweight_recipe_with_site_11."rightBorder" <= basisweight_with_site_11."rightBorder") AND (basisweight_with_site_11.depth >= basisweight_recipe_with_site_11."depthRecipe") AND (basisweight_with_site_11."leftBorder" >= basisweight_recipe_with_site_11."leftBorderRecipe") AND (basisweight_with_site_11."rightBorder" <= basisweight_recipe_with_site_11."rightBorderRecipe") AND (basisweight_with_site_11."idRecipe" = basisweight_recipe_with_site_11."idRecipe"))
334. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on basisweight_with_site basisweight_with_site_11 (cost=0.00..0.06 rows=1 width=38) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (("idGuest" = '-1'::integer) AND ("idRecipeFamily" = '-1'::integer) AND ("idMealType" = 0))
  • Rows Removed by Filter: 2
335. 0.000 0.000 ↓ 0.0 0

CTE Scan on basisweight_recipe_with_site basisweight_recipe_with_site_11 (cost=0.00..0.02 rows=1 width=64) (never executed)

336. 0.000 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.12 rows=1 width=62) (actual time=0.001..0.001 rows=0 loops=1)

  • Join Filter: ((basisweight_recipe_with_site_12.depth >= basisweight_with_site_12.depth) AND (basisweight_recipe_with_site_12."leftBorder" >= basisweight_with_site_12."leftBorder") AND (basisweight_recipe_with_site_12."rightBorder" <= basisweight_with_site_12."rightBorder") AND (basisweight_with_site_12.depth >= basisweight_recipe_with_site_12."depthRecipe") AND (basisweight_with_site_12."leftBorder" >= basisweight_recipe_with_site_12."leftBorderRecipe") AND (basisweight_with_site_12."rightBorder" <= basisweight_recipe_with_site_12."rightBorderRecipe") AND (basisweight_with_site_12."idMealType" = basisweight_recipe_with_site_12."idMealType") AND (basisweight_with_site_12."idRecipeFamily" = basisweight_recipe_with_site_12."idRecipeFamilyRecipe"))
337. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on basisweight_with_site basisweight_with_site_12 (cost=0.00..0.05 rows=1 width=38) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (("idGuest" = '-1'::integer) AND ("idRecipe" = '-1'::integer))
  • Rows Removed by Filter: 2
338. 0.000 0.000 ↓ 0.0 0

CTE Scan on basisweight_recipe_with_site basisweight_recipe_with_site_12 (cost=0.00..0.02 rows=1 width=68) (never executed)

339. 0.001 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.12 rows=1 width=62) (actual time=0.001..0.001 rows=0 loops=1)

  • Join Filter: ((basisweight_recipe_with_site_13.depth >= basisweight_with_site_13.depth) AND (basisweight_recipe_with_site_13."leftBorder" >= basisweight_with_site_13."leftBorder") AND (basisweight_recipe_with_site_13."rightBorder" <= basisweight_with_site_13."rightBorder") AND (basisweight_with_site_13.depth >= basisweight_recipe_with_site_13."depthRecipe") AND (basisweight_with_site_13."leftBorder" >= basisweight_recipe_with_site_13."leftBorderRecipe") AND (basisweight_with_site_13."rightBorder" <= basisweight_recipe_with_site_13."rightBorderRecipe") AND (basisweight_with_site_13."idMealType" = basisweight_recipe_with_site_13."idMealType"))
340. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on basisweight_with_site basisweight_with_site_13 (cost=0.00..0.06 rows=1 width=38) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (("idGuest" = '-1'::integer) AND ("idRecipe" = '-1'::integer) AND ("idRecipeFamily" = '-1'::integer))
  • Rows Removed by Filter: 2
341. 0.000 0.000 ↓ 0.0 0

CTE Scan on basisweight_recipe_with_site basisweight_recipe_with_site_13 (cost=0.00..0.02 rows=1 width=64) (never executed)

342. 0.000 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.12 rows=1 width=62) (actual time=0.001..0.001 rows=0 loops=1)

  • Join Filter: ((basisweight_recipe_with_site_14.depth >= basisweight_with_site_14.depth) AND (basisweight_recipe_with_site_14."leftBorder" >= basisweight_with_site_14."leftBorder") AND (basisweight_recipe_with_site_14."rightBorder" <= basisweight_with_site_14."rightBorder") AND (basisweight_with_site_14.depth >= basisweight_recipe_with_site_14."depthRecipe") AND (basisweight_with_site_14."leftBorder" >= basisweight_recipe_with_site_14."leftBorderRecipe") AND (basisweight_with_site_14."rightBorder" <= basisweight_recipe_with_site_14."rightBorderRecipe") AND (basisweight_with_site_14."idRecipeFamily" = basisweight_recipe_with_site_14."idRecipeFamilyRecipe"))
343. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on basisweight_with_site basisweight_with_site_14 (cost=0.00..0.06 rows=1 width=38) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (("idGuest" = '-1'::integer) AND ("idRecipe" = '-1'::integer) AND ("idMealType" = 0))
  • Rows Removed by Filter: 2
344. 0.000 0.000 ↓ 0.0 0

CTE Scan on basisweight_recipe_with_site basisweight_recipe_with_site_14 (cost=0.00..0.02 rows=1 width=68) (never executed)

345. 0.000 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.13 rows=1 width=62) (actual time=0.001..0.001 rows=0 loops=1)

  • Join Filter: ((basisweight_recipe_with_site_15.depth >= basisweight_with_site_15.depth) AND (basisweight_recipe_with_site_15."leftBorder" >= basisweight_with_site_15."leftBorder") AND (basisweight_recipe_with_site_15."rightBorder" <= basisweight_with_site_15."rightBorder") AND (basisweight_with_site_15.depth >= basisweight_recipe_with_site_15."depthRecipe") AND (basisweight_with_site_15."leftBorder" >= basisweight_recipe_with_site_15."leftBorderRecipe") AND (basisweight_with_site_15."rightBorder" <= basisweight_recipe_with_site_15."rightBorderRecipe"))
346. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on basisweight_with_site basisweight_with_site_15 (cost=0.00..0.06 rows=1 width=38) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (("idGuest" = '-1'::integer) AND ("idRecipe" = '-1'::integer) AND ("idRecipeFamily" = '-1'::integer) AND ("idMealType" = 0))
  • Rows Removed by Filter: 2
347. 0.000 0.000 ↓ 0.0 0

CTE Scan on basisweight_recipe_with_site basisweight_recipe_with_site_15 (cost=0.00..0.02 rows=1 width=64) (never executed)

348.          

CTE categorymenu_recipe_with_basisweight

349. 0.005 1.494 ↑ 1.5 11 1

Unique (cost=0.64..0.84 rows=16 width=62) (actual time=1.489..1.494 rows=11 loops=1)

350. 0.032 1.489 ↑ 1.3 12 1

Sort (cost=0.64..0.68 rows=16 width=62) (actual time=1.489..1.489 rows=12 loops=1)

  • Sort Key: fast_recipe_with_basisweight."idCategoryMenu", fast_recipe_with_basisweight."idRecipe", fast_recipe_with_basisweight."idGuest", fast_recipe_with_basisweight."idMealType", fast_recipe_with_basisweight."depthOrder" DESC, fast_recipe_with_basisweight."idRecipeOrder" DESC, fast_recipe_with_basisweight."idGuestOrder" DESC, fast_recipe_with_basisweight."idMealTypeOrder" DESC, fast_recipe_with_basisweight."idRecipeFamilyOrder" DESC
  • Sort Method: quicksort Memory: 25kB
351. 1.457 1.457 ↑ 1.3 12 1

CTE Scan on fast_recipe_with_basisweight (cost=0.00..0.32 rows=16 width=62) (actual time=1.406..1.457 rows=12 loops=1)

352.          

CTE menu_basisweight_with_null

353. 0.021 3.285 ↓ 5.5 11 1

Hash Right Join (cost=0.08..0.65 rows=2 width=53) (actual time=3.271..3.285 rows=11 loops=1)

  • Hash Cond: ((categorymenu_recipe_with_basisweight."idRecipe" = menu_with_recipe_and_categorymenu_1."idRecipe") AND (categorymenu_recipe_with_basisweight."idGuest" = menu_with_recipe_and_categorymenu_1."idGuest") AND (categorymenu_recipe_with_basisweight."idMealType" = menu_with_recipe_and_categorymenu_1."idMealType") AND (categorymenu_recipe_with_basisweight."idCategoryMenu" = menu_with_recipe_and_categorymenu_1."idCategoryMenu"))
354. 1.499 1.499 ↑ 1.5 11 1

CTE Scan on categorymenu_recipe_with_basisweight (cost=0.00..0.32 rows=16 width=44) (actual time=1.492..1.499 rows=11 loops=1)

355. 0.008 1.765 ↓ 5.5 11 1

Hash (cost=0.04..0.04 rows=2 width=21) (actual time=1.765..1.765 rows=11 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
356. 1.757 1.757 ↓ 5.5 11 1

CTE Scan on menu_with_recipe_and_categorymenu menu_with_recipe_and_categorymenu_1 (cost=0.00..0.04 rows=2 width=21) (actual time=1.751..1.757 rows=11 loops=1)

357.          

CTE menu_basisweight

358. 0.014 3.314 ↓ 5.5 11 1

Nested Loop (cost=0.15..16.43 rows=2 width=85) (actual time=3.281..3.314 rows=11 loops=1)

359. 3.289 3.289 ↓ 5.5 11 1

CTE Scan on menu_basisweight_with_null (cost=0.00..0.04 rows=2 width=53) (actual time=3.272..3.289 rows=11 loops=1)

360. 0.011 0.011 ↑ 1.0 1 11

Index Scan using "Recipe_PK" on "Recipe" "Recipe_2" (cost=0.15..8.17 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=11)

  • Index Cond: (id = menu_basisweight_with_null."idRecipe")
361.          

CTE menu_component_prepare_ratio_without_parent

362. 0.038 3.586 ↓ 24.0 24 1

WindowAgg (cost=0.00..0.23 rows=1 width=485) (actual time=3.460..3.586 rows=24 loops=1)

363. 0.029 3.548 ↓ 24.0 24 1

Nested Loop (cost=0.00..0.20 rows=1 width=449) (actual time=3.450..3.548 rows=24 loops=1)

  • Join Filter: ((menu_basisweight."idSiteOwner" = menu_compressed_2."idSiteOwner") AND (menu_basisweight."idCategoryMenu" = menu_compressed_2."idCategoryMenu") AND (recipe_component_1."idRecipeMenu" = menu_compressed_2."idRecipeMenu") AND (menu_basisweight."idMealType" = menu_compressed_2."idMealType"))
  • Rows Removed by Join Filter: 192
364. 0.018 3.495 ↓ 24.0 24 1

Nested Loop (cost=0.00..0.17 rows=1 width=367) (actual time=3.442..3.495 rows=24 loops=1)

  • Join Filter: ((menu_basisweight."idRecipe" = recipe_component_1."idSubRecipeOwner") AND ((recipe_component_1."idRecipeVersionMainParent" = menu_basisweight."idCategoryMenuVersion") OR (recipe_component_1."idRecipeVersionMainParent" = 1)))
  • Rows Removed by Join Filter: 240
365. 0.165 0.165 ↓ 24.0 24 1

CTE Scan on recipe_component recipe_component_1 (cost=0.00..0.09 rows=1 width=324) (actual time=0.157..0.165 rows=24 loops=1)

  • Filter: (type = 1)
  • Rows Removed by Filter: 3
366. 3.312 3.312 ↓ 5.5 11 24

CTE Scan on menu_basisweight (cost=0.00..0.04 rows=2 width=51) (actual time=0.137..0.138 rows=11 loops=24)

367. 0.024 0.024 ↓ 9.0 9 24

CTE Scan on menu_compressed menu_compressed_2 (cost=0.00..0.02 rows=1 width=96) (actual time=0.000..0.001 rows=9 loops=24)

368.          

CTE menu_component_prepare_ratio

369. 0.003 3.699 ↓ 12.0 24 1

Append (cost=0.15..8.34 rows=2 width=517) (actual time=3.483..3.699 rows=24 loops=1)

370. 0.011 3.680 ↓ 6.0 6 1

Nested Loop (cost=0.15..8.29 rows=1 width=517) (actual time=3.483..3.680 rows=6 loops=1)

  • Join Filter: (menu_basisweight_parent."idRecipe" = "Recipe_3".id)
371. 0.011 3.663 ↓ 6.0 6 1

Nested Loop (cost=0.00..0.10 rows=1 width=521) (actual time=3.475..3.663 rows=6 loops=1)

  • Join Filter: ((menu_component_prepare_ratio_without_parent."idSiteOwner" = menu_basisweight_parent."idSiteOwner") AND (menu_component_prepare_ratio_without_parent."idCategoryMenu" = menu_basisweight_parent."idCategoryMenu") AND (menu_component_prepare_ratio_without_parent."idRecipeMenu" = menu_basisweight_parent."idRecipe") AND (menu_component_prepare_ratio_without_parent."idMealType" = menu_basisweight_parent."idMealType"))
  • Rows Removed by Join Filter: 60
372. 3.610 3.610 ↓ 6.0 6 1

CTE Scan on menu_component_prepare_ratio_without_parent (cost=0.00..0.02 rows=1 width=485) (actual time=3.462..3.610 rows=6 loops=1)

  • Filter: ("idSubRecipeOwner" <> "idRecipeMenu")
  • Rows Removed by Filter: 18
373. 0.042 0.042 ↓ 5.5 11 6

CTE Scan on menu_basisweight menu_basisweight_parent (cost=0.00..0.04 rows=2 width=46) (actual time=0.000..0.007 rows=11 loops=6)

374. 0.006 0.006 ↑ 1.0 1 6

Index Scan using "Recipe_PK" on "Recipe" "Recipe_3" (cost=0.15..8.17 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=6)

  • Index Cond: (id = menu_component_prepare_ratio_without_parent."idRecipeMenu")
375. 0.006 0.016 ↓ 18.0 18 1

Subquery Scan on *SELECT* 2 (cost=0.00..0.04 rows=1 width=517) (actual time=0.003..0.016 rows=18 loops=1)

376. 0.010 0.010 ↓ 18.0 18 1

CTE Scan on menu_component_prepare_ratio_without_parent menu_component_prepare_ratio_without_parent_1 (cost=0.00..0.02 rows=1 width=489) (actual time=0.002..0.010 rows=18 loops=1)

  • Filter: ("idSubRecipeOwner" = "idRecipeMenu")
  • Rows Removed by Filter: 6
377.          

CTE menu_component_with_ratio_result

378. 0.002 3.755 ↓ 12.0 24 1

Append (cost=0.00..0.17 rows=2 width=484) (actual time=3.490..3.755 rows=24 loops=1)

379. 0.007 3.743 ↓ 23.0 23 1

Subquery Scan on *SELECT* 1_2 (cost=0.00..0.07 rows=1 width=484) (actual time=3.490..3.743 rows=23 loops=1)

380. 3.736 3.736 ↓ 23.0 23 1

CTE Scan on menu_component_prepare_ratio (cost=0.00..0.06 rows=1 width=456) (actual time=3.488..3.736 rows=23 loops=1)

  • Filter: (("idProductionUnit" <> 1) OR (("idProductionUnit" = 1) AND ("weightPerPiece" = '0'::numeric)))
  • Rows Removed by Filter: 1
381. 0.010 0.010 ↑ 1.0 1 1

CTE Scan on menu_component_prepare_ratio menu_component_prepare_ratio_1 (cost=0.00..0.07 rows=1 width=484) (actual time=0.008..0.010 rows=1 loops=1)

  • Filter: (("weightPerPiece" > '0'::numeric) AND ("idProductionUnit" = 1))
  • Rows Removed by Filter: 23
382.          

CTE menu_component

383. 3.808 3.808 ↓ 12.0 24 1

CTE Scan on menu_component_with_ratio_result (cost=0.00..0.07 rows=2 width=452) (actual time=3.496..3.808 rows=24 loops=1)

384.          

CTE unnested_smartselection_rules

385. 0.000 0.297 ↓ 0.0 0 1

Nested Loop (cost=0.01..4.04 rows=200 width=200) (actual time=0.297..0.297 rows=0 loops=1)

386. 0.297 0.297 ↓ 0.0 0 1

CTE Scan on smartselection_rule smartselection_rule_2 (cost=0.00..0.04 rows=2 width=184) (actual time=0.297..0.297 rows=0 loops=1)

387. 0.000 0.000 ↓ 0.0 0

Function Scan on x (cost=0.01..1.00 rows=100 width=16) (never executed)

388.          

CTE only_rules_on_category_menu

389. 0.000 0.000 ↓ 0.0 0

CTE Scan on unnested_smartselection_rules (cost=0.00..5.00 rows=1 width=56) (never executed)

  • Filter: (abs("applyToColumn") = 1)
390.          

CTE category_menu_parent_of_applied_rule

391. 0.000 0.000 ↓ 0.0 0

Unique (cost=1.98..1.99 rows=1 width=56) (never executed)

392. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.98..1.98 rows=1 width=56) (never executed)

  • Sort Key: category_menu_parents."idCategoryMenu", only_rules_on_category_menu."dateValidRule", only_rules_on_category_menu."siteDepth" DESC, only_rules_on_category_menu.priority DESC, only_rules_on_category_menu."idSmartSelectionRule" DESC
393. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=0.03..1.97 rows=1 width=56) (never executed)

  • Hash Cond: (category_menu_parents."idCategoryMenuParent" = only_rules_on_category_menu."idCategoryMenu")
394. 0.000 0.000 ↓ 0.0 0

CTE Scan on category_menu_parents (cost=0.00..1.62 rows=81 width=8) (never executed)

395. 0.000 0.000 ↓ 0.0 0

Hash (cost=0.02..0.02 rows=1 width=52) (never executed)

396. 0.000 0.000 ↓ 0.0 0

CTE Scan on only_rules_on_category_menu (cost=0.00..0.02 rows=1 width=52) (never executed)

397.          

CTE precomputed_smartselection

398. 0.000 0.306 ↓ 0.0 0 1

WindowAgg (cost=11.64..20.14 rows=200 width=216) (actual time=0.306..0.306 rows=0 loops=1)

399. 0.001 0.306 ↓ 0.0 0 1

WindowAgg (cost=11.64..16.14 rows=200 width=208) (actual time=0.305..0.306 rows=0 loops=1)

400. 0.007 0.305 ↓ 0.0 0 1

Sort (cost=11.64..12.14 rows=200 width=200) (actual time=0.305..0.305 rows=0 loops=1)

  • Sort Key: unnested_smartselection_rules_1."idSmartSelectionRule", unnested_smartselection_rules_1."applyToIndex
  • Sort Method: quicksort Memory: 25kB
401. 0.298 0.298 ↓ 0.0 0 1

CTE Scan on unnested_smartselection_rules unnested_smartselection_rules_1 (cost=0.00..4.00 rows=200 width=200) (actual time=0.298..0.298 rows=0 loops=1)

402.          

CTE checked_smartselection_rule

403. 0.004 0.343 ↓ 0.0 0 1

Append (cost=0.00..71.29 rows=14 width=346) (actual time=0.343..0.343 rows=0 loops=1)

404. 0.001 0.307 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1_3 (cost=0.00..5.08 rows=1 width=346) (actual time=0.307..0.307 rows=0 loops=1)

405. 0.000 0.306 ↓ 0.0 0 1

Nested Loop (cost=0.00..5.08 rows=1 width=668) (actual time=0.306..0.306 rows=0 loops=1)

  • Join Filter: ((menu_component."dateStableConsumption" && precomputed_smartselection."dateValidRule") AND (abs(precomputed_smartselection."applyToId") = menu_component."idCategoryMenu"))
406. 0.306 0.306 ↓ 0.0 0 1

CTE Scan on precomputed_smartselection (cost=0.00..5.00 rows=1 width=208) (actual time=0.306..0.306 rows=0 loops=1)

  • Filter: (abs("applyToColumn") = 1)
407. 0.000 0.000 ↓ 0.0 0

CTE Scan on menu_component (cost=0.00..0.04 rows=2 width=142) (never executed)

408. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2_1 (cost=0.00..5.11 rows=1 width=346) (actual time=0.001..0.001 rows=0 loops=1)

409. 0.000 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.00..5.10 rows=1 width=668) (actual time=0.001..0.001 rows=0 loops=1)

  • Join Filter: ((menu_component_1."idCategoryMenu" = category_menu_parent_of_applied_rule."idCategoryMenu") AND (precomputed_smartselection_1."dateValidRule" = category_menu_parent_of_applied_rule."dateValidRule") AND (abs(precomputed_smartselection_1."applyToId") = category_menu_parent_of_applied_rule."idCategoryMenuParent"))
410. 0.001 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.00..5.07 rows=1 width=350) (actual time=0.000..0.001 rows=0 loops=1)

  • Join Filter: (menu_component_1."dateStableConsumption" && precomputed_smartselection_1."dateValidRule")
411. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on precomputed_smartselection precomputed_smartselection_1 (cost=0.00..5.00 rows=1 width=208) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (abs("applyToColumn") = 1)
412. 0.000 0.000 ↓ 0.0 0

CTE Scan on menu_component menu_component_1 (cost=0.00..0.04 rows=2 width=142) (never executed)

413. 0.000 0.000 ↓ 0.0 0

CTE Scan on category_menu_parent_of_applied_rule (cost=0.00..0.02 rows=1 width=40) (never executed)

414. 0.001 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 3 (cost=0.00..5.08 rows=1 width=346) (actual time=0.001..0.001 rows=0 loops=1)

415. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0.00..5.08 rows=1 width=668) (actual time=0.000..0.000 rows=0 loops=1)

  • Join Filter: ((menu_component_2."dateStableConsumption" && precomputed_smartselection_2."dateValidRule") AND (abs(precomputed_smartselection_2."applyToId") = menu_component_2."idDiet"))
416. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on precomputed_smartselection precomputed_smartselection_2 (cost=0.00..5.00 rows=1 width=208) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (abs("applyToColumn") = 2)
417. 0.000 0.000 ↓ 0.0 0

CTE Scan on menu_component menu_component_2 (cost=0.00..0.04 rows=2 width=140) (never executed)

418. 0.001 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 4 (cost=0.00..5.08 rows=1 width=346) (actual time=0.001..0.001 rows=0 loops=1)

419. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0.00..5.08 rows=1 width=668) (actual time=0.000..0.000 rows=0 loops=1)

  • Join Filter: ((menu_component_3."dateStableConsumption" && precomputed_smartselection_3."dateValidRule") AND (abs(precomputed_smartselection_3."applyToId") = menu_component_3."idDish"))
420. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on precomputed_smartselection precomputed_smartselection_3 (cost=0.00..5.00 rows=1 width=208) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (abs("applyToColumn") = 3)
421. 0.000 0.000 ↓ 0.0 0

CTE Scan on menu_component menu_component_3 (cost=0.00..0.04 rows=2 width=140) (never executed)

422. 0.001 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 5 (cost=0.00..5.08 rows=1 width=346) (actual time=0.001..0.001 rows=0 loops=1)

423. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0.00..5.08 rows=1 width=668) (actual time=0.000..0.000 rows=0 loops=1)

  • Join Filter: ((menu_component_4."dateStableConsumption" && precomputed_smartselection_4."dateValidRule") AND (abs(precomputed_smartselection_4."applyToId") = menu_component_4."idGeneric"))
424. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on precomputed_smartselection precomputed_smartselection_4 (cost=0.00..5.00 rows=1 width=208) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (abs("applyToColumn") = 4)
425. 0.000 0.000 ↓ 0.0 0

CTE Scan on menu_component menu_component_4 (cost=0.00..0.04 rows=2 width=138) (never executed)

426. 0.013 0.014 ↓ 0.0 0 1

Subquery Scan on *SELECT* 6 (cost=0.00..5.08 rows=1 width=346) (actual time=0.014..0.014 rows=0 loops=1)

427. 0.001 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.00..5.08 rows=1 width=668) (actual time=0.000..0.001 rows=0 loops=1)

  • Join Filter: ((menu_component_5."dateStableConsumption" && precomputed_smartselection_5."dateValidRule") AND (abs(precomputed_smartselection_5."applyToId") = menu_component_5."idGenericFamilies"[1]))
428. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on precomputed_smartselection precomputed_smartselection_5 (cost=0.00..5.00 rows=1 width=208) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (abs("applyToColumn") = 5)
429. 0.000 0.000 ↓ 0.0 0

CTE Scan on menu_component menu_component_5 (cost=0.00..0.04 rows=2 width=170) (never executed)

430. 0.001 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 7 (cost=0.00..5.08 rows=1 width=346) (actual time=0.001..0.001 rows=0 loops=1)

431. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0.00..5.08 rows=1 width=668) (actual time=0.000..0.000 rows=0 loops=1)

  • Join Filter: ((menu_component_6."dateStableConsumption" && precomputed_smartselection_6."dateValidRule") AND (abs(precomputed_smartselection_6."applyToId") = menu_component_6."idGenericFamilies"[2]))
432. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on precomputed_smartselection precomputed_smartselection_6 (cost=0.00..5.00 rows=1 width=208) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (abs("applyToColumn") = 5)
433. 0.000 0.000 ↓ 0.0 0

CTE Scan on menu_component menu_component_6 (cost=0.00..0.04 rows=2 width=170) (never executed)

434. 0.001 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 8 (cost=0.00..5.08 rows=1 width=346) (actual time=0.001..0.001 rows=0 loops=1)

435. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0.00..5.08 rows=1 width=668) (actual time=0.000..0.000 rows=0 loops=1)

  • Join Filter: ((menu_component_7."dateStableConsumption" && precomputed_smartselection_7."dateValidRule") AND (abs(precomputed_smartselection_7."applyToId") = menu_component_7."idGuest"))
436. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on precomputed_smartselection precomputed_smartselection_7 (cost=0.00..5.00 rows=1 width=208) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (abs("applyToColumn") = 6)
437. 0.000 0.000 ↓ 0.0 0

CTE Scan on menu_component menu_component_7 (cost=0.00..0.04 rows=2 width=140) (never executed)

438. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 9 (cost=0.00..5.08 rows=1 width=346) (actual time=0.001..0.001 rows=0 loops=1)

439. 0.001 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.00..5.08 rows=1 width=668) (actual time=0.001..0.001 rows=0 loops=1)

  • Join Filter: ((menu_component_8."dateStableConsumption" && precomputed_smartselection_8."dateValidRule") AND (abs(precomputed_smartselection_8."applyToId") = menu_component_8."idMealType"))
440. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on precomputed_smartselection precomputed_smartselection_8 (cost=0.00..5.00 rows=1 width=208) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (abs("applyToColumn") = 7)
441. 0.000 0.000 ↓ 0.0 0

CTE Scan on menu_component menu_component_8 (cost=0.00..0.04 rows=2 width=140) (never executed)

442. 0.001 0.002 ↓ 0.0 0 1

Subquery Scan on *SELECT* 10 (cost=0.00..5.08 rows=1 width=346) (actual time=0.002..0.002 rows=0 loops=1)

443. 0.001 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.00..5.08 rows=1 width=668) (actual time=0.001..0.001 rows=0 loops=1)

  • Join Filter: ((menu_component_9."dateStableConsumption" && precomputed_smartselection_9."dateValidRule") AND (abs(precomputed_smartselection_9."applyToId") = menu_component_9."idRecipeParent"))
444. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on precomputed_smartselection precomputed_smartselection_9 (cost=0.00..5.00 rows=1 width=208) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (abs("applyToColumn") = 8)
445. 0.000 0.000 ↓ 0.0 0

CTE Scan on menu_component menu_component_9 (cost=0.00..0.04 rows=2 width=142) (never executed)

446. 0.001 0.005 ↓ 0.0 0 1

Subquery Scan on *SELECT* 11 (cost=0.00..5.08 rows=1 width=346) (actual time=0.005..0.005 rows=0 loops=1)

447. 0.003 0.004 ↓ 0.0 0 1

Nested Loop (cost=0.00..5.08 rows=1 width=668) (actual time=0.004..0.004 rows=0 loops=1)

  • Join Filter: ((menu_component_10."dateStableConsumption" && precomputed_smartselection_10."dateValidRule") AND (abs(precomputed_smartselection_10."applyToId") = menu_component_10."idRecipeFamilies"[1]))
448. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on precomputed_smartselection precomputed_smartselection_10 (cost=0.00..5.00 rows=1 width=208) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (abs("applyToColumn") = 9)
449. 0.000 0.000 ↓ 0.0 0

CTE Scan on menu_component menu_component_10 (cost=0.00..0.04 rows=2 width=170) (never executed)

450. 0.002 0.002 ↓ 0.0 0 1

Subquery Scan on *SELECT* 12 (cost=0.00..5.08 rows=1 width=346) (actual time=0.002..0.002 rows=0 loops=1)

451. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0.00..5.08 rows=1 width=668) (actual time=0.000..0.000 rows=0 loops=1)

  • Join Filter: ((menu_component_11."dateStableConsumption" && precomputed_smartselection_11."dateValidRule") AND (abs(precomputed_smartselection_11."applyToId") = menu_component_11."idRecipeFamilies"[2]))
452. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on precomputed_smartselection precomputed_smartselection_11 (cost=0.00..5.00 rows=1 width=208) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (abs("applyToColumn") = 9)
453. 0.000 0.000 ↓ 0.0 0

CTE Scan on menu_component menu_component_11 (cost=0.00..0.04 rows=2 width=170) (never executed)

454. 0.001 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 13 (cost=0.00..5.08 rows=1 width=346) (actual time=0.001..0.001 rows=0 loops=1)

455. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0.00..5.08 rows=1 width=668) (actual time=0.000..0.000 rows=0 loops=1)

  • Join Filter: ((menu_component_12."dateStableConsumption" && precomputed_smartselection_12."dateValidRule") AND (abs(precomputed_smartselection_12."applyToId") = menu_component_12."idSegment"))
456. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on precomputed_smartselection precomputed_smartselection_12 (cost=0.00..5.00 rows=1 width=208) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (abs("applyToColumn") = 10)
457. 0.000 0.000 ↓ 0.0 0

CTE Scan on menu_component menu_component_12 (cost=0.00..0.04 rows=2 width=140) (never executed)

458. 0.001 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 14 (cost=0.00..5.08 rows=1 width=346) (actual time=0.001..0.001 rows=0 loops=1)

459. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0.00..5.08 rows=1 width=668) (actual time=0.000..0.000 rows=0 loops=1)

  • Join Filter: ((menu_component_13."dateStableConsumption" && precomputed_smartselection_13."dateValidRule") AND (abs(precomputed_smartselection_13."applyToId") = menu_component_13."idTexture"))
460. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on precomputed_smartselection precomputed_smartselection_13 (cost=0.00..5.00 rows=1 width=208) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (abs("applyToColumn") = 11)
461. 0.000 0.000 ↓ 0.0 0

CTE Scan on menu_component menu_component_13 (cost=0.00..0.04 rows=2 width=140) (never executed)

462.          

CTE resolved_smartselection_rule_or

463. 0.000 0.348 ↓ 0.0 0 1

Unique (cost=0.55..0.69 rows=14 width=346) (actual time=0.348..0.348 rows=0 loops=1)

464. 0.005 0.348 ↓ 0.0 0 1

Sort (cost=0.55..0.58 rows=14 width=346) (actual time=0.348..0.348 rows=0 loops=1)

  • Sort Key: checked_smartselection_rule."idSmartSelectionRule", checked_smartselection_rule."andGroupIndex", checked_smartselection_rule."rowNumberMenuComponent
  • Sort Method: quicksort Memory: 25kB
465. 0.343 0.343 ↓ 0.0 0 1

CTE Scan on checked_smartselection_rule (cost=0.00..0.28 rows=14 width=346) (actual time=0.343..0.343 rows=0 loops=1)

466.          

CTE resolved_smartselection_rule_and

467. 0.001 0.357 ↓ 0.0 0 1

Subquery Scan on sub (cost=0.55..1.25 rows=1 width=314) (actual time=0.357..0.357 rows=0 loops=1)

  • Filter: ((sub."nbAndGroupCounted" = sub."nbAndGroup") AND (sub."nbExclusionCounted" = 0) AND (sub."distinctFilter" = 1))
468. 0.000 0.356 ↓ 0.0 0 1

WindowAgg (cost=0.55..1.00 rows=14 width=370) (actual time=0.356..0.356 rows=0 loops=1)

469. 0.007 0.356 ↓ 0.0 0 1

Sort (cost=0.55..0.58 rows=14 width=326) (actual time=0.356..0.356 rows=0 loops=1)

  • Sort Key: resolved_smartselection_rule_or."idSmartSelectionRule", resolved_smartselection_rule_or."rowNumberMenuComponent", resolved_smartselection_rule_or."dateStableConsumption
  • Sort Method: quicksort Memory: 25kB
470. 0.349 0.349 ↓ 0.0 0 1

CTE Scan on resolved_smartselection_rule_or (cost=0.00..0.28 rows=14 width=326) (actual time=0.349..0.349 rows=0 loops=1)

471.          

CTE component_rule

472. 0.000 0.375 ↓ 0.0 0 1

WindowAgg (cost=0.07..0.10 rows=1 width=330) (actual time=0.375..0.375 rows=0 loops=1)

473. 0.010 0.375 ↓ 0.0 0 1

Sort (cost=0.07..0.08 rows=1 width=322) (actual time=0.375..0.375 rows=0 loops=1)

  • Sort Key: resolved_smartselection_rule_and."dateStableConsumption", resolved_smartselection_rule_and."rowNumberMenuComponent", resolved_smartselection_rule_and."siteDepth", resolved_smartselection_rule_and.priority, resolved_smartselection_rule_and."idSmartSelectionRule" DESC
  • Sort Method: quicksort Memory: 25kB
474. 0.000 0.365 ↓ 0.0 0 1

WindowAgg (cost=0.03..0.06 rows=1 width=322) (actual time=0.365..0.365 rows=0 loops=1)

475. 0.008 0.365 ↓ 0.0 0 1

Sort (cost=0.03..0.04 rows=1 width=314) (actual time=0.365..0.365 rows=0 loops=1)

  • Sort Key: resolved_smartselection_rule_and."dateStableConsumption", resolved_smartselection_rule_and."rowNumberMenuComponent", resolved_smartselection_rule_and."siteDepth" DESC, resolved_smartselection_rule_and.priority DESC, resolved_smartselection_rule_and."idSmartSelectionRule" DESC
  • Sort Method: quicksort Memory: 25kB
476. 0.357 0.357 ↓ 0.0 0 1

CTE Scan on resolved_smartselection_rule_and (cost=0.00..0.02 rows=1 width=314) (actual time=0.357..0.357 rows=0 loops=1)

477.          

CTE component_no_rule

478. 0.022 3.853 ↓ 24.0 24 1

Hash Left Join (cost=0.03..0.09 rows=1 width=322) (actual time=3.511..3.853 rows=24 loops=1)

  • Hash Cond: (menu_component_14."rowNumberMenuComponent" = resolved_smartselection_rule_and_1."rowNumberMenuComponent")
  • Filter: (resolved_smartselection_rule_and_1."idSmartSelectionRule" IS NULL)
479. 3.830 3.830 ↓ 12.0 24 1

CTE Scan on menu_component menu_component_14 (cost=0.00..0.04 rows=2 width=138) (actual time=3.498..3.830 rows=24 loops=1)

480. 0.001 0.001 ↓ 0.0 0 1

Hash (cost=0.02..0.02 rows=1 width=180) (actual time=0.001..0.001 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
481. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on resolved_smartselection_rule_and resolved_smartselection_rule_and_1 (cost=0.00..0.02 rows=1 width=180) (actual time=0.000..0.000 rows=0 loops=1)

482.          

CTE component_compressed

483. 0.012 4.373 ↓ 10.0 20 1

Unique (cost=0.11..0.21 rows=2 width=262) (actual time=4.312..4.373 rows=20 loops=1)

484. 0.055 4.361 ↓ 12.0 24 1

WindowAgg (cost=0.11..0.17 rows=2 width=262) (actual time=4.311..4.361 rows=24 loops=1)

485. 0.050 4.306 ↓ 12.0 24 1

Sort (cost=0.11..0.11 rows=2 width=234) (actual time=4.305..4.306 rows=24 loops=1)

  • Sort Key: sub_1."dateStableConsumption", sub_1."dateStableProduction", sub_1."idSmartSelectionRule", sub_1."idGeneric", sub_1."idProductionUnit", sub_1."weightPerPieceTarget", sub_1."choiceNumber
  • Sort Method: quicksort Memory: 28kB
486. 0.005 4.256 ↓ 12.0 24 1

Subquery Scan on sub_1 (cost=0.00..0.10 rows=2 width=234) (actual time=3.892..4.256 rows=24 loops=1)

487. 0.003 4.251 ↓ 12.0 24 1

Append (cost=0.00..0.07 rows=2 width=330) (actual time=3.891..4.251 rows=24 loops=1)

488. 0.376 0.376 ↓ 0.0 0 1

CTE Scan on component_rule (cost=0.00..0.02 rows=1 width=330) (actual time=0.376..0.376 rows=0 loops=1)

489. 0.008 3.872 ↓ 24.0 24 1

Subquery Scan on *SELECT* 2_2 (cost=0.00..0.04 rows=1 width=330) (actual time=3.514..3.872 rows=24 loops=1)

490. 3.864 3.864 ↓ 24.0 24 1

CTE Scan on component_no_rule (cost=0.00..0.02 rows=1 width=322) (actual time=3.512..3.864 rows=24 loops=1)

491.          

CTE product_unnested

492. 0.162 0.176 ↓ 3.0 299 1

ProjectSet (cost=0.00..0.53 rows=100 width=519) (actual time=0.004..0.176 rows=299 loops=1)

493. 0.014 0.014 ↓ 138.0 138 1

CTE Scan on product product_2 (cost=0.00..0.02 rows=1 width=515) (actual time=0.000..0.014 rows=138 loops=1)

494.          

CTE smart_selection_temp

495. 0.146 4.912 ↓ 26.0 52 1

Hash Right Join (cost=0.07..3.15 rows=2 width=711) (actual time=4.457..4.912 rows=52 loops=1)

  • Hash Cond: (product_3."idGenericUn" = component_compressed."idGeneric")
  • Join Filter: (product_3."dateValid" @> component_compressed."dateStableProduction")
496. 0.378 0.378 ↓ 3.0 299 1

CTE Scan on product_unnested product_3 (cost=0.00..2.00 rows=100 width=519) (actual time=0.006..0.378 rows=299 loops=1)

497. 0.008 4.388 ↓ 10.0 20 1

Hash (cost=0.04..0.04 rows=2 width=254) (actual time=4.388..4.388 rows=20 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
498. 4.380 4.380 ↓ 10.0 20 1

CTE Scan on component_compressed (cost=0.00..0.04 rows=2 width=254) (actual time=4.313..4.380 rows=20 loops=1)

499.          

CTE smart_selection_unnest

500. 0.065 5.110 ↑ 2.9 68 1

WindowAgg (cost=0.00..6.05 rows=200 width=583) (actual time=4.470..5.110 rows=68 loops=1)

501. 0.074 5.045 ↑ 2.9 68 1

ProjectSet (cost=0.00..1.05 rows=200 width=579) (actual time=4.466..5.045 rows=68 loops=1)

502. 4.971 4.971 ↓ 26.0 52 1

CTE Scan on smart_selection_temp (cost=0.00..0.04 rows=2 width=607) (actual time=4.460..4.971 rows=52 loops=1)

503.          

CTE smart_selection

504. 0.020 0.880 ↑ 8.3 24 1

Unique (cost=11.64..14.14 rows=200 width=121) (actual time=0.858..0.880 rows=24 loops=1)

505. 0.145 0.860 ↑ 2.9 68 1

Sort (cost=11.64..12.14 rows=200 width=121) (actual time=0.857..0.860 rows=68 loops=1)

  • Sort Key: smart_selection_unnest."dateStableConsumption", smart_selection_unnest."rowNumberMenuComponent", smart_selection_unnest."idGeneric", smart_selection_unnest."weightPerPieceTarget", smart_selection_unnest."isMatching" DESC, smart_selection_unnest."pieceRank" DESC NULLS LAST, smart_selection_unnest."choiceNumberSelected", smart_selection_unnest."priceComparisonUnit", smart_selection_unnest."idProduct", smart_selection_unnest."idSupplierProduct", (smart_selection_unnest."allowedSuppliers"[1])
  • Sort Method: quicksort Memory: 34kB
506. 0.715 0.715 ↑ 2.9 68 1

CTE Scan on smart_selection_unnest (cost=0.00..4.00 rows=200 width=121) (actual time=0.002..0.715 rows=68 loops=1)

507.          

CTE menu_component_selected_compact

508. 0.056 0.964 ↓ 12.0 24 1

Hash Join (cost=0.07..4.90 rows=2 width=379) (actual time=0.899..0.964 rows=24 loops=1)

  • Hash Cond: (smart_selection."rowNumberMenuComponent" = menu_component_15."rowNumberMenuComponent")
509. 0.887 0.887 ↑ 8.3 24 1

CTE Scan on smart_selection (cost=0.00..4.00 rows=200 width=101) (actual time=0.859..0.887 rows=24 loops=1)

510. 0.012 0.021 ↓ 12.0 24 1

Hash (cost=0.04..0.04 rows=2 width=252) (actual time=0.021..0.021 rows=24 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
511. 0.009 0.009 ↓ 12.0 24 1

CTE Scan on menu_component menu_component_15 (cost=0.00..0.04 rows=2 width=252) (actual time=0.002..0.009 rows=24 loops=1)

512.          

CTE menu_component_selected

513. 0.040 5.522 ↓ 12.0 24 1

Hash Join (cost=0.07..4.83 rows=2 width=861) (actual time=5.493..5.522 rows=24 loops=1)

  • Hash Cond: (smart_selection_unnest_1.index = menu_component_selected_compact.index)
514. 4.480 4.480 ↑ 2.9 68 1

CTE Scan on smart_selection_unnest smart_selection_unnest_1 (cost=0.00..4.00 rows=200 width=583) (actual time=4.473..4.480 rows=68 loops=1)

515. 0.012 1.002 ↓ 12.0 24 1

Hash (cost=0.04..0.04 rows=2 width=282) (actual time=1.002..1.002 rows=24 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
516. 0.990 0.990 ↓ 12.0 24 1

CTE Scan on menu_component_selected_compact (cost=0.00..0.04 rows=2 width=282) (actual time=0.902..0.990 rows=24 loops=1)

517.          

CTE get_nutritions

518. 0.006 0.145 ↓ 9.0 9 1

Unique (cost=2.26..2.27 rows=1 width=326) (actual time=0.137..0.145 rows=9 loops=1)

519. 0.023 0.139 ↓ 63.0 63 1

Sort (cost=2.26..2.27 rows=1 width=326) (actual time=0.137..0.139 rows=63 loops=1)

  • Sort Key: menu_with_production_time_lag_4."idRecipeMenu", "Nutrition_Recipe"."idNutrition
  • Sort Method: quicksort Memory: 29kB
520. 0.000 0.116 ↓ 63.0 63 1

Nested Loop Left Join (cost=0.17..2.25 rows=1 width=326) (actual time=0.051..0.116 rows=63 loops=1)

521. 0.023 0.053 ↓ 63.0 63 1

Hash Join (cost=0.03..1.88 rows=1 width=8) (actual time=0.038..0.053 rows=63 loops=1)

  • Hash Cond: ("Nutrition_Recipe"."idRecipe" = menu_with_production_time_lag_4."idRecipeMenu")
522. 0.008 0.008 ↑ 1.0 61 1

Seq Scan on "Nutrition_Recipe" (cost=0.00..1.61 rows=61 width=8) (actual time=0.005..0.008 rows=61 loops=1)

523. 0.008 0.022 ↓ 63.0 63 1

Hash (cost=0.02..0.02 rows=1 width=4) (actual time=0.022..0.022 rows=63 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
524. 0.014 0.014 ↓ 63.0 63 1

CTE Scan on menu_with_production_time_lag menu_with_production_time_lag_4 (cost=0.00..0.02 rows=1 width=4) (actual time=0.001..0.014 rows=63 loops=1)

525. 0.063 0.063 ↑ 1.0 1 63

Index Scan using "Nutrition_PK" on "Nutrition" "Nutrition_1" (cost=0.14..0.35 rows=1 width=322) (actual time=0.001..0.001 rows=1 loops=63)

  • Index Cond: (id = "Nutrition_Recipe"."idNutrition")
526.          

CTE get_nutritions_array

527. 0.003 0.166 ↓ 7.0 7 1

Unique (cost=0.03..0.06 rows=1 width=68) (actual time=0.155..0.166 rows=7 loops=1)

528. 0.014 0.163 ↓ 9.0 9 1

WindowAgg (cost=0.03..0.05 rows=1 width=68) (actual time=0.155..0.163 rows=9 loops=1)

529. 0.002 0.149 ↓ 9.0 9 1

Sort (cost=0.03..0.04 rows=1 width=326) (actual time=0.149..0.149 rows=9 loops=1)

  • Sort Key: get_nutritions."idRecipeMenu
  • Sort Method: quicksort Memory: 25kB
530. 0.147 0.147 ↓ 9.0 9 1

CTE Scan on get_nutritions (cost=0.00..0.02 rows=1 width=326) (actual time=0.138..0.147 rows=9 loops=1)

531.          

CTE get_products_allergens

532. 0.002 5.572 ↑ 15.4 13 1

Result (cost=0.00..4.05 rows=200 width=80) (actual time=5.519..5.572 rows=13 loops=1)

533. 0.016 5.570 ↑ 15.4 13 1

ProjectSet (cost=0.00..1.05 rows=200 width=78) (actual time=5.518..5.570 rows=13 loops=1)

534. 5.554 5.554 ↓ 12.0 24 1

CTE Scan on menu_component_selected (cost=0.00..0.04 rows=2 width=108) (actual time=5.497..5.554 rows=24 loops=1)

535.          

CTE get_products_info_array

536. 0.042 5.657 ↑ 33.3 6 1

GroupAggregate (cost=11.64..30.14 rows=200 width=108) (actual time=5.631..5.657 rows=6 loops=1)

  • Group Key: get_products_allergens."dateStableConsumption", get_products_allergens."dateStableProduction", get_products_allergens."idCategoryMenu", get_products_allergens."idMealType", get_products_allergens."idDish", get_products_allergens."idRecipeMenu
537. 0.038 5.615 ↑ 15.4 13 1

Sort (cost=11.64..12.14 rows=200 width=80) (actual time=5.614..5.615 rows=13 loops=1)

  • Sort Key: get_products_allergens."dateStableConsumption", get_products_allergens."dateStableProduction", get_products_allergens."idCategoryMenu", get_products_allergens."idMealType", get_products_allergens."idDish", get_products_allergens."idRecipeMenu
  • Sort Method: quicksort Memory: 26kB
538. 5.577 5.577 ↑ 15.4 13 1

CTE Scan on get_products_allergens (cost=0.00..4.00 rows=200 width=80) (actual time=5.520..5.577 rows=13 loops=1)

539.          

CTE recipes

540. 0.054 0.057 ↓ 4.5 9 1

HashAggregate (cost=0.11..0.14 rows=2 width=110) (actual time=0.049..0.057 rows=9 loops=1)

  • Group Key: menu_component_selected_1."dateStableConsumption", menu_component_selected_1."dateStableProduction", menu_component_selected_1."idCategoryMenu", menu_component_selected_1."idMealType", menu_component_selected_1."idDish", menu_component_selected_1."idRecipeMenu
541. 0.003 0.003 ↓ 12.0 24 1

CTE Scan on menu_component_selected menu_component_selected_1 (cost=0.00..0.04 rows=2 width=122) (actual time=0.001..0.003 rows=24 loops=1)

542.          

CTE menu_with_recipes_detailed

543. 0.035 7.889 ↓ 31.5 63 1

Unique (cost=7.36..7.54 rows=2 width=685) (actual time=7.852..7.889 rows=63 loops=1)

544. 0.193 7.854 ↓ 31.5 63 1

Sort (cost=7.36..7.36 rows=2 width=685) (actual time=7.852..7.854 rows=63 loops=1)

  • Sort Key: menu_with_production_time_lag_5.id, menu_with_production_time_lag_5."dateConsumption", menu_with_production_time_lag_5.type, menu_with_production_time_lag_5."plannedQty", menu_with_production_time_lag_5."realQty", menu_with_production_time_lag_5.status, menu_with_production_time_lag_5."isClosedPeriod", menu_with_production_time_lag_5."realQtyMenuElement", menu_with_production_time_lag_5."preComputedCostMenuElement", menu_with_production_time_lag_5."idMealType", menu_with_production_time_lag_5."idCategoryMenu", menu_with_production_time_lag_5."idMenuElement", menu_with_production_time_lag_5."idNutritionFamily", menu_with_production_time_lag_5."labelNutritionFamily", menu_with_production_time_lag_5.color, menu_with_production_time_lag_5."idElementRecipe", menu_with_production_time_lag_5."idProductionWorkshop", menu_with_production_time_lag_5."idRecipeMenu", menu_with_production_time_lag_5."lifetimeRecipe", menu_with_production_time_lag_5."idDish", menu_with_production_time_lag_5."idGuest", menu_with_production_time_lag_5."sortMenuElement", menu_with_production_time_lag_5."plannedQtyMenuElement", menu_with_production_time_lag_5."isSetByUserMenuElement", menu_with_production_time_lag_5."idRecipeVersion", menu_with_production_time_lag_5."isAParentCategoryMenu", recipes."totalPrice", (CASE WHEN (menu_with_production_time_lag_5."isCostAlreadyComputed" AND (menu_with_production_time_lag_5."preComputedAllergens" IS NOT NULL)) THEN (menu_with_production_time_lag_5."preComputedAllergens")::integer[] ELSE get_products_info_array."idAllergens" END), get_nutritions_array."arrayIdNutrition", get_nutritions_array."arrayLabelNutrition", (COALESCE(recipes."isIdeal", true)), (COALESCE(recipes."isForced", false)), menu_with_production_time_lag_5."dateProduction", menu_with_production_time_lag_5."nbProductionDaysBeforeConsumption", (CASE WHEN menu_with_production_time_lag_5."isCostAlreadyComputed" THEN menu_with_production_time_lag_5."preComputedNutritionalComposition" ELSE NULL::double precision[] END)
  • Sort Method: quicksort Memory: 40kB
545. 0.005 7.661 ↓ 31.5 63 1

Append (cost=0.04..7.35 rows=2 width=685) (actual time=7.298..7.661 rows=63 loops=1)

546. 0.059 7.649 ↓ 63.0 63 1

Nested Loop Left Join (cost=0.04..7.20 rows=1 width=685) (actual time=7.297..7.649 rows=63 loops=1)

  • Join Filter: (menu_with_production_time_lag_5."idRecipeMenu" = get_nutritions_array."idRecipeMenu")
  • Rows Removed by Join Filter: 392
547. 0.134 7.401 ↓ 63.0 63 1

Nested Loop Left Join (cost=0.04..7.14 rows=1 width=654) (actual time=7.138..7.401 rows=63 loops=1)

  • Join Filter: ((NOT menu_with_production_time_lag_5."isExcludedRecipe") AND (recipes."dateStableConsumption" @> menu_with_production_time_lag_5."dateConsumption") AND (recipes."dateStableProduction" @> menu_with_production_time_lag_5."dateProduction") AND (recipes."idCategoryMenu" = menu_with_production_time_lag_5."idCategoryMenu") AND (recipes."idMealType" = menu_with_production_time_lag_5."idMealType") AND (recipes."idDish" = menu_with_production_time_lag_5."idDish") AND (recipes."idRecipeMenu" = menu_with_production_time_lag_5."idRecipeMenu"))
  • Rows Removed by Join Filter: 504
548. 0.052 7.141 ↓ 63.0 63 1

Hash Right Join (cost=0.04..7.05 rows=1 width=621) (actual time=7.077..7.141 rows=63 loops=1)

  • Hash Cond: ((get_products_info_array."idCategoryMenu" = menu_with_production_time_lag_5."idCategoryMenu") AND (get_products_info_array."idMealType" = menu_with_production_time_lag_5."idMealType") AND (get_products_info_array."idDish" = menu_with_production_time_lag_5."idDish") AND (get_products_info_array."idRecipeMenu" = menu_with_production_time_lag_5."idRecipeMenu"))
  • Join Filter: ((get_products_info_array."dateStableConsumption" @> menu_with_production_time_lag_5."dateConsumption") AND (get_products_info_array."dateStableProduction" @> menu_with_production_time_lag_5."dateProduction"))
549. 5.661 5.661 ↑ 33.3 6 1

CTE Scan on get_products_info_array (cost=0.00..4.00 rows=200 width=108) (actual time=5.632..5.661 rows=6 loops=1)

550. 0.027 1.428 ↓ 63.0 63 1

Hash (cost=0.02..0.02 rows=1 width=589) (actual time=1.428..1.428 rows=63 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 17kB
551. 1.401 1.401 ↓ 63.0 63 1

CTE Scan on menu_with_production_time_lag menu_with_production_time_lag_5 (cost=0.00..0.02 rows=1 width=589) (actual time=1.322..1.401 rows=63 loops=1)

552. 0.126 0.126 ↓ 4.5 9 63

CTE Scan on recipes (cost=0.00..0.04 rows=2 width=110) (actual time=0.001..0.002 rows=9 loops=63)

553. 0.189 0.189 ↓ 7.0 7 63

CTE Scan on get_nutritions_array (cost=0.00..0.02 rows=1 width=68) (actual time=0.003..0.003 rows=7 loops=63)

554. 0.000 0.007 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2_3 (cost=0.00..0.12 rows=1 width=685) (actual time=0.007..0.007 rows=0 loops=1)

555. 0.007 0.007 ↓ 0.0 0 1

CTE Scan on menus_without_recipes menus_without_recipes_1 (cost=0.00..0.11 rows=1 width=657) (actual time=0.007..0.007 rows=0 loops=1)

  • Filter: ("idElementRecipe" = 1)
  • Rows Removed by Filter: 63
556.          

CTE menu_components_for_nut_composition

557. 0.012 0.012 ↓ 12.0 24 1

CTE Scan on menu_component_selected menu_component_selected_2 (cost=0.00..0.04 rows=2 width=90) (actual time=0.002..0.012 rows=24 loops=1)

558.          

CTE menu_component_selected_with_weight

559. 0.010 0.239 ↓ 12.0 24 1

Unique (cost=33.95..33.99 rows=2 width=224) (actual time=0.228..0.239 rows=24 loops=1)

560. 0.022 0.229 ↓ 12.0 24 1

Sort (cost=33.95..33.95 rows=2 width=224) (actual time=0.228..0.229 rows=24 loops=1)

  • Sort Key: menu_components_for_nut_composition."idRecipeMenu", menu_components_for_nut_composition."idProduct", menu_components_for_nut_composition."idGeneric", menu_components_for_nut_composition."dateStableConsumption", menu_components_for_nut_composition.qty, menu_components_for_nut_composition."idMealType", menu_components_for_nut_composition."idDish
  • Sort Method: quicksort Memory: 30kB
561. 0.039 0.207 ↓ 12.0 24 1

Nested Loop Left Join (cost=0.70..33.94 rows=2 width=224) (actual time=0.039..0.207 rows=24 loops=1)

562. 0.000 0.120 ↓ 12.0 24 1

Nested Loop Left Join (cost=0.55..17.36 rows=2 width=138) (actual time=0.021..0.120 rows=24 loops=1)

563. 0.024 0.024 ↓ 12.0 24 1

CTE Scan on menu_components_for_nut_composition (cost=0.00..0.04 rows=2 width=90) (actual time=0.003..0.024 rows=24 loops=1)

564. 0.024 0.096 ↑ 1.0 1 24

Nested Loop Left Join (cost=0.55..8.65 rows=1 width=52) (actual time=0.003..0.004 rows=1 loops=24)

565. 0.048 0.048 ↑ 1.0 1 24

Index Only Scan using "Element_PK" on "Element" generic (cost=0.28..8.29 rows=1 width=4) (actual time=0.001..0.002 rows=1 loops=24)

  • Index Cond: (id = menu_components_for_nut_composition."idGeneric")
  • Heap Fetches: 24
566. 0.024 0.024 ↑ 1.0 1 24

Index Scan using "Generic_PK" on "Generic" (cost=0.27..0.36 rows=1 width=52) (actual time=0.001..0.001 rows=1 loops=24)

  • Index Cond: ("idElement" = generic.id)
567. 0.048 0.048 ↑ 1.0 1 24

Index Scan using "Product_PK" on "Product" (cost=0.15..8.19 rows=1 width=57) (actual time=0.002..0.002 rows=1 loops=24)

  • Index Cond: ("idElement" = menu_components_for_nut_composition."idProduct")
  • Filter: (((((((((protein + carbohydrate) + lipid))::double precision + "includingSugar") + "includingSaturatedFattyAcids") + calcium) + fiber) + salt) > '0'::double precision)
  • Rows Removed by Filter: 0
568.          

CTE menu_recipe_nut_composition_compute

569. 0.006 0.334 ↓ 4.5 9 1

Unique (cost=0.25..0.26 rows=2 width=112) (actual time=0.327..0.334 rows=9 loops=1)

570. 0.016 0.328 ↓ 12.0 24 1

Sort (cost=0.25..0.25 rows=2 width=112) (actual time=0.327..0.328 rows=24 loops=1)

  • Sort Key: menu_component_selected_with_weight."idRecipeMenu", menu_component_selected_with_weight."dateStableConsumption
  • Sort Method: quicksort Memory: 28kB
571. 0.048 0.312 ↓ 12.0 24 1

WindowAgg (cost=0.05..0.24 rows=2 width=112) (actual time=0.284..0.312 rows=24 loops=1)

572. 0.018 0.264 ↓ 12.0 24 1

Sort (cost=0.05..0.06 rows=2 width=184) (actual time=0.263..0.264 rows=24 loops=1)

  • Sort Key: menu_component_selected_with_weight."dateStableConsumption", menu_component_selected_with_weight."idRecipeMenu", menu_component_selected_with_weight."idMealType", menu_component_selected_with_weight."idDish
  • Sort Method: quicksort Memory: 28kB
573. 0.246 0.246 ↓ 12.0 24 1

CTE Scan on menu_component_selected_with_weight (cost=0.00..0.04 rows=2 width=184) (actual time=0.230..0.246 rows=24 loops=1)

574.          

CTE menu_recipes_nut_composition

575. 0.005 0.442 ↓ 4.5 9 1

Unique (cost=0.05..0.34 rows=2 width=68) (actual time=0.378..0.442 rows=9 loops=1)

576. 0.089 0.437 ↓ 4.5 9 1

WindowAgg (cost=0.05..0.33 rows=2 width=68) (actual time=0.377..0.437 rows=9 loops=1)

577. 0.012 0.348 ↓ 4.5 9 1

Sort (cost=0.05..0.06 rows=2 width=108) (actual time=0.347..0.348 rows=9 loops=1)

  • Sort Key: menu_recipe_nut_composition_compute."idRecipeMenu", menu_recipe_nut_composition_compute."dateStableConsumption
  • Sort Method: quicksort Memory: 26kB
578. 0.336 0.336 ↓ 4.5 9 1

CTE Scan on menu_recipe_nut_composition_compute (cost=0.00..0.04 rows=2 width=108) (actual time=0.329..0.336 rows=9 loops=1)

579.          

CTE allergen_details

580. 0.162 0.231 ↓ 84.0 84 1

Nested Loop (cost=0.00..1.75 rows=1 width=186) (actual time=0.027..0.231 rows=84 loops=1)

  • Join Filter: (ARRAY[("Allergen".id)::integer] <@ menu_with_recipes_detailed."idAllergens")
  • Rows Removed by Join Filter: 861
581. 0.006 0.006 ↓ 31.5 63 1

CTE Scan on menu_with_recipes_detailed (cost=0.00..0.04 rows=2 width=40) (actual time=0.000..0.006 rows=63 loops=1)

582. 0.056 0.063 ↑ 1.0 15 63

Materialize (cost=0.00..1.22 rows=15 width=178) (actual time=0.000..0.001 rows=15 loops=63)

583. 0.007 0.007 ↑ 1.0 15 1

Seq Scan on "Allergen" (cost=0.00..1.15 rows=15 width=178) (actual time=0.005..0.007 rows=15 loops=1)

584.          

CTE allergen_labels

585. 0.087 0.367 ↓ 42.0 42 1

GroupAggregate (cost=0.03..0.06 rows=1 width=40) (actual time=0.288..0.367 rows=42 loops=1)

  • Group Key: allergen_details."idMenuElement
586. 0.026 0.280 ↓ 84.0 84 1

Sort (cost=0.03..0.04 rows=1 width=126) (actual time=0.276..0.280 rows=84 loops=1)

  • Sort Key: allergen_details."idMenuElement
  • Sort Method: quicksort Memory: 30kB
587. 0.254 0.254 ↓ 84.0 84 1

CTE Scan on allergen_details (cost=0.00..0.02 rows=1 width=126) (actual time=0.029..0.254 rows=84 loops=1)

588.          

CTE allergen_info

589. 0.179 0.437 ↓ 84.0 84 1

Nested Loop (cost=0.00..0.05 rows=1 width=218) (actual time=0.005..0.437 rows=84 loops=1)

  • Join Filter: (allergen_details_1."idMenuElement" = allergen_labels_1."idMenuElement")
  • Rows Removed by Join Filter: 3,444
590. 0.006 0.006 ↓ 84.0 84 1

CTE Scan on allergen_details allergen_details_1 (cost=0.00..0.02 rows=1 width=186) (actual time=0.000..0.006 rows=84 loops=1)

591. 0.252 0.252 ↓ 42.0 42 84

CTE Scan on allergen_labels allergen_labels_1 (cost=0.00..0.02 rows=1 width=40) (actual time=0.000..0.003 rows=42 loops=84)

592.          

CTE menu_computed

593. 0.691 10.719 ↓ 31.5 63 1

WindowAgg (cost=52.34..53.06 rows=2 width=2,297) (actual time=10.099..10.719 rows=63 loops=1)

594. 0.103 10.028 ↓ 31.5 63 1

Sort (cost=52.34..52.35 rows=2 width=1,832) (actual time=10.025..10.028 rows=63 loops=1)

  • Sort Key: menu_with_recipes_detailed_1.id
  • Sort Method: quicksort Memory: 88kB
595. 0.040 9.925 ↓ 31.5 63 1

Nested Loop Left Join (cost=49.32..52.33 rows=2 width=1,832) (actual time=9.856..9.925 rows=63 loops=1)

596. 0.063 9.885 ↓ 31.5 63 1

Hash Right Join (cost=49.19..51.72 rows=2 width=1,804) (actual time=9.848..9.885 rows=63 loops=1)

  • Hash Cond: (("RecipePrice"."idElementRecipe" = menu_with_recipes_detailed_1."idElement") AND ("RecipePrice"."idCategoryMenu" = menu_with_recipes_detailed_1."idCategoryMenu"))
  • Join Filter: ("RecipePrice"."dateValid" @> menu_with_recipes_detailed_1."dateConsumption")
597. 0.008 0.008 ↑ 1.0 87 1

Seq Scan on "RecipePrice" (cost=0.00..1.87 rows=87 width=32) (actual time=0.004..0.008 rows=87 loops=1)

598. 0.074 9.814 ↓ 31.5 63 1

Hash (cost=49.16..49.16 rows=2 width=1,790) (actual time=9.814..9.814 rows=63 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 52kB
599. 0.097 9.740 ↓ 31.5 63 1

Merge Left Join (cost=29.63..49.16 rows=2 width=1,790) (actual time=9.319..9.740 rows=63 loops=1)

  • Merge Cond: ((menu_with_recipes_detailed_1."idCategoryMenu" = menu_basisweight_1."idCategoryMenu") AND (menu_with_recipes_detailed_1."idMealType" = menu_basisweight_1."idMealType"))
  • Join Filter: ((menu_with_recipes_detailed_1."idRecipeMenu" = menu_basisweight_1."idRecipe") AND (menu_with_recipes_detailed_1."idGuest" = menu_basisweight_1."idGuest"))
  • Rows Removed by Join Filter: 630
600. 0.054 9.603 ↓ 31.5 63 1

Nested Loop Left Join (cost=29.58..49.07 rows=2 width=1,760) (actual time=9.301..9.603 rows=63 loops=1)

  • Join Filter: (menu_with_recipes_detailed_1."idProductionWorkshop" = "ProductionWorkshop".id)
  • Rows Removed by Join Filter: 182
601. 0.057 9.549 ↓ 31.5 63 1

Nested Loop Left Join (cost=29.58..47.81 rows=2 width=1,642) (actual time=9.292..9.549 rows=63 loops=1)

  • Join Filter: ("RecipeFamily"."idRecipeFamilyParent" = familyparent.id)
  • Rows Removed by Join Filter: 210
602. 0.056 9.492 ↓ 31.5 63 1

Nested Loop Left Join (cost=29.58..46.13 rows=2 width=1,524) (actual time=9.284..9.492 rows=63 loops=1)

603. 0.037 9.310 ↓ 31.5 63 1

Merge Left Join (cost=29.30..29.37 rows=2 width=1,268) (actual time=9.270..9.310 rows=63 loops=1)

  • Merge Cond: ((menu_with_recipes_detailed_1."idCategoryMenu" = categorymenuweek."idCategoryMenu") AND (menu_with_recipes_detailed_1."idMealType" = categorymenuweek."idMealType"))
604. 0.080 9.225 ↓ 31.5 63 1

Sort (cost=29.10..29.11 rows=2 width=1,266) (actual time=9.221..9.225 rows=63 loops=1)

  • Sort Key: menu_with_recipes_detailed_1."idCategoryMenu", menu_with_recipes_detailed_1."idMealType
  • Sort Method: quicksort Memory: 81kB
605. 0.043 9.145 ↓ 31.5 63 1

Merge Left Join (cost=29.05..29.09 rows=2 width=1,266) (actual time=9.101..9.145 rows=63 loops=1)

  • Merge Cond: (menu_with_recipes_detailed_1."idRecipeMenu" = menu_recipes_nut_composition."idRecipeMenu")
  • Join Filter: (menu_recipes_nut_composition."dateStableConsumption" @> menu_with_recipes_detailed_1."dateConsumption")
606. 0.061 8.648 ↓ 31.5 63 1

Sort (cost=29.00..29.00 rows=2 width=1,234) (actual time=8.645..8.648 rows=63 loops=1)

  • Sort Key: menu_with_recipes_detailed_1."idRecipeMenu
  • Sort Method: quicksort Memory: 55kB
607. 0.044 8.587 ↓ 31.5 63 1

Nested Loop Left Join (cost=3.25..28.99 rows=2 width=1,234) (actual time=8.363..8.587 rows=63 loops=1)

  • Join Filter: (site_prod_param."dateValid" @> menu_with_recipes_detailed_1."dateConsumption")
608. 0.030 8.543 ↓ 31.5 63 1

Nested Loop Left Join (cost=3.25..28.93 rows=2 width=1,202) (actual time=8.355..8.543 rows=63 loops=1)

  • Join Filter: ("MealType".id = "MealType_Dish"."idMealType")
  • Rows Removed by Join Filter: 63
609. 0.099 8.450 ↓ 31.5 63 1

Nested Loop (cost=3.12..27.51 rows=2 width=1,204) (actual time=8.346..8.450 rows=63 loops=1)

  • Join Filter: ("Dish"."idDishGroup" = "DishGroup".id)
  • Rows Removed by Join Filter: 378
610. 0.014 0.014 ↑ 1.0 7 1

Seq Scan on "DishGroup" (cost=0.00..1.07 rows=7 width=122) (actual time=0.013..0.014 rows=7 loops=1)

611. 0.053 8.337 ↓ 31.5 63 7

Materialize (cost=3.12..26.24 rows=2 width=1,086) (actual time=1.163..1.191 rows=63 loops=7)

612. 0.034 8.284 ↓ 31.5 63 1

Nested Loop (cost=3.12..26.23 rows=2 width=1,086) (actual time=8.134..8.284 rows=63 loops=1)

613. 0.060 8.187 ↓ 31.5 63 1

Hash Join (cost=2.84..9.62 rows=2 width=1,059) (actual time=8.123..8.187 rows=63 loops=1)

  • Hash Cond: ("CategoryMenu_3".id = menu_with_recipes_detailed_1."idCategoryMenu")
614. 0.027 0.027 ↑ 1.0 273 1

Seq Scan on "CategoryMenu" "CategoryMenu_3" (cost=0.00..5.73 rows=273 width=20) (actual time=0.004..0.027 rows=273 loops=1)

615. 0.039 8.100 ↓ 31.5 63 1

Hash (cost=2.82..2.82 rows=2 width=1,043) (actual time=8.100..8.100 rows=63 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 24kB
616. 0.043 8.061 ↓ 31.5 63 1

Hash Join (cost=1.38..2.82 rows=2 width=1,043) (actual time=8.033..8.061 rows=63 loops=1)

  • Hash Cond: ("Dish".id = menu_with_recipes_detailed_1."idDish")
617. 0.006 0.006 ↑ 1.0 30 1

Seq Scan on "Dish" (cost=0.00..1.30 rows=30 width=182) (actual time=0.004..0.006 rows=30 loops=1)

618. 0.030 8.012 ↓ 31.5 63 1

Hash (cost=1.36..1.36 rows=2 width=861) (actual time=8.012..8.012 rows=63 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 23kB
619. 0.036 7.982 ↓ 31.5 63 1

Hash Join (cost=0.07..1.36 rows=2 width=861) (actual time=7.961..7.982 rows=63 loops=1)

  • Hash Cond: ("MealType".id = menu_with_recipes_detailed_1."idMealType")
620. 0.005 0.005 ↑ 1.0 20 1

Seq Scan on "MealType" (cost=0.00..1.20 rows=20 width=180) (actual time=0.003..0.005 rows=20 loops=1)

621. 0.028 7.941 ↓ 31.5 63 1

Hash (cost=0.04..0.04 rows=2 width=681) (actual time=7.941..7.941 rows=63 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 22kB
622. 7.913 7.913 ↓ 31.5 63 1

CTE Scan on menu_with_recipes_detailed menu_with_recipes_detailed_1 (cost=0.00..0.04 rows=2 width=681) (actual time=7.855..7.913 rows=63 loops=1)

623. 0.063 0.063 ↑ 1.0 1 63

Index Scan using "Element_PK" on "Element" (cost=0.28..8.29 rows=1 width=31) (actual time=0.001..0.001 rows=1 loops=63)

  • Index Cond: (id = menu_with_recipes_detailed_1."idElement")
624. 0.063 0.063 ↓ 2.0 2 63

Index Scan using "MealType_Dish_PK" on "MealType_Dish" (cost=0.14..0.70 rows=1 width=6) (actual time=0.001..0.001 rows=2 loops=63)

  • Index Cond: ("idDish" = "Dish".id)
625. 0.000 0.000 ↑ 1.0 1 63

CTE Scan on site_prod_param (cost=0.00..0.02 rows=1 width=64) (actual time=0.000..0.000 rows=1 loops=63)

626. 0.009 0.454 ↓ 28.5 57 1

Sort (cost=0.05..0.06 rows=2 width=68) (actual time=0.451..0.454 rows=57 loops=1)

  • Sort Key: menu_recipes_nut_composition."idRecipeMenu
  • Sort Method: quicksort Memory: 28kB
627. 0.445 0.445 ↓ 4.5 9 1

CTE Scan on menu_recipes_nut_composition (cost=0.00..0.04 rows=2 width=68) (actual time=0.379..0.445 rows=9 loops=1)

628. 0.010 0.048 ↑ 6.0 1 1

Sort (cost=0.20..0.21 rows=6 width=8) (actual time=0.045..0.048 rows=1 loops=1)

  • Sort Key: categorymenuweek."idCategoryMenu", categorymenuweek."idMealType
  • Sort Method: quicksort Memory: 25kB
629. 0.038 0.038 ↑ 6.0 1 1

CTE Scan on categorymenuweek (cost=0.00..0.12 rows=6 width=8) (actual time=0.036..0.038 rows=1 loops=1)

630. 0.000 0.126 ↑ 1.0 1 63

Nested Loop Left Join (cost=0.28..8.37 rows=1 width=260) (actual time=0.002..0.002 rows=1 loops=63)

631. 0.063 0.063 ↑ 1.0 1 63

Index Scan using "Recipe_PK" on "Recipe" "Recipe_4" (cost=0.15..8.17 rows=1 width=80) (actual time=0.001..0.001 rows=1 loops=63)

  • Index Cond: (id = menu_with_recipes_detailed_1."idRecipeMenu")
632. 0.063 0.063 ↑ 1.0 1 63

Index Scan using "RecipeFamily_PK" on "RecipeFamily" (cost=0.14..0.20 rows=1 width=184) (actual time=0.001..0.001 rows=1 loops=63)

  • Index Cond: ("Recipe_4"."idRecipeFamily" = id)
633. 0.000 0.000 ↑ 4.0 4 63

Materialize (cost=0.00..1.24 rows=16 width=122) (actual time=0.000..0.000 rows=4 loops=63)

634. 0.004 0.004 ↑ 1.3 12 1

Seq Scan on "RecipeFamily" familyparent (cost=0.00..1.16 rows=16 width=122) (actual time=0.003..0.004 rows=12 loops=1)

635. 0.000 0.000 ↑ 1.5 4 63

Materialize (cost=0.00..1.09 rows=6 width=122) (actual time=0.000..0.000 rows=4 loops=63)

636. 0.003 0.003 ↑ 1.0 6 1

Seq Scan on "ProductionWorkshop" (cost=0.00..1.06 rows=6 width=122) (actual time=0.002..0.003 rows=6 loops=1)

637. 0.037 0.040 ↓ 315.5 631 1

Sort (cost=0.05..0.06 rows=2 width=44) (actual time=0.011..0.040 rows=631 loops=1)

  • Sort Key: menu_basisweight_1."idCategoryMenu", menu_basisweight_1."idMealType
  • Sort Method: quicksort Memory: 25kB
638. 0.003 0.003 ↓ 5.5 11 1

CTE Scan on menu_basisweight menu_basisweight_1 (cost=0.00..0.04 rows=2 width=44) (actual time=0.001..0.003 rows=11 loops=1)

639. 0.000 0.000 ↓ 0.0 0 63

Index Scan using "Tax_PK" on "Tax" (cost=0.14..0.29 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=63)

  • Index Cond: ("RecipePrice"."idTax" = id)
640.          

CTE get_products_info

641. 0.023 0.155 ↓ 23.0 23 1

Nested Loop (cost=0.20..11.80 rows=1 width=112) (actual time=0.054..0.155 rows=23 loops=1)

642. 0.049 0.108 ↓ 12.0 24 1

Hash Join (cost=0.07..11.42 rows=2 width=120) (actual time=0.039..0.108 rows=24 loops=1)

  • Hash Cond: ("Generic_1"."idElement" = menu_component_selected_3."idGeneric")
643. 0.038 0.038 ↑ 1.0 388 1

Seq Scan on "Generic" "Generic_1" (cost=0.00..9.88 rows=388 width=8) (actual time=0.004..0.038 rows=388 loops=1)

644. 0.009 0.021 ↓ 12.0 24 1

Hash (cost=0.04..0.04 rows=2 width=116) (actual time=0.021..0.021 rows=24 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
645. 0.012 0.012 ↓ 12.0 24 1

CTE Scan on menu_component_selected menu_component_selected_3 (cost=0.00..0.04 rows=2 width=116) (actual time=0.002..0.012 rows=24 loops=1)

646. 0.024 0.024 ↑ 1.0 1 24

Index Scan using "GenericFamily_PK" on "GenericFamily" (cost=0.13..0.18 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=24)

  • Index Cond: (id = "Generic_1"."idGenericFamily")
  • Filter: "isFood
  • Rows Removed by Filter: 0
647.          

CTE get_products_certifications

648. 0.002 0.016 ↑ 7.7 13 1

Result (cost=0.00..2.03 rows=100 width=80) (actual time=0.004..0.016 rows=13 loops=1)

649. 0.012 0.014 ↑ 7.7 13 1

ProjectSet (cost=0.00..0.53 rows=100 width=78) (actual time=0.003..0.014 rows=13 loops=1)

650. 0.002 0.002 ↓ 23.0 23 1

CTE Scan on get_products_info (cost=0.00..0.02 rows=1 width=108) (actual time=0.000..0.002 rows=23 loops=1)

651.          

CTE get_products_ids_and_certifications_array

652. 0.061 0.364 ↓ 9.0 9 1

GroupAggregate (cost=4.31..4.41 rows=1 width=140) (actual time=0.329..0.364 rows=9 loops=1)

  • Group Key: get_products_info_1."dateStableConsumption", get_products_info_1."dateStableProduction", get_products_info_1."idCategoryMenu", get_products_info_1."idMealType", get_products_info_1."idDish", get_products_info_1."idRecipeMenu
653. 0.057 0.303 ↓ 46.0 46 1

Sort (cost=4.31..4.32 rows=1 width=84) (actual time=0.300..0.303 rows=46 loops=1)

  • Sort Key: get_products_info_1."dateStableConsumption", get_products_info_1."dateStableProduction", get_products_info_1."idCategoryMenu", get_products_info_1."idMealType", get_products_info_1."idDish", get_products_info_1."idRecipeMenu
  • Sort Method: quicksort Memory: 28kB
654. 0.041 0.246 ↓ 46.0 46 1

Hash Right Join (cost=0.04..4.30 rows=1 width=84) (actual time=0.207..0.246 rows=46 loops=1)

  • Hash Cond: ((get_products_certifications."idCategoryMenu" = get_products_info_1."idCategoryMenu") AND (get_products_certifications."idMealType" = get_products_info_1."idMealType") AND (get_products_certifications."idDish" = get_products_info_1."idDish") AND (get_products_certifications."idRecipeMenu" = get_products_info_1."idRecipeMenu") AND (get_products_certifications."dateStableConsumption" = get_products_info_1."dateStableConsumption") AND (get_products_certifications."dateStableProduction" = get_products_info_1."dateStableProduction"))
655. 0.020 0.020 ↑ 7.7 13 1

CTE Scan on get_products_certifications (cost=0.00..2.00 rows=100 width=80) (actual time=0.005..0.020 rows=13 loops=1)

656. 0.016 0.185 ↓ 23.0 23 1

Hash (cost=0.02..0.02 rows=1 width=80) (actual time=0.185..0.185 rows=23 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
657. 0.169 0.169 ↓ 23.0 23 1

CTE Scan on get_products_info get_products_info_1 (cost=0.00..0.02 rows=1 width=80) (actual time=0.056..0.169 rows=23 loops=1)

658.          

CTE get_products_info_by_menu_element

659. 0.114 0.561 ↓ 63.0 63 1

Nested Loop Left Join (cost=0.00..0.07 rows=1 width=72) (actual time=0.366..0.561 rows=63 loops=1)

  • Join Filter: ((get_products_ids_and_certifications_array."dateStableConsumption" @> menu_with_production_time_lag_6."dateConsumption") AND (get_products_ids_and_certifications_array."dateStableProduction" @> menu_with_production_time_lag_6."dateProduction") AND (get_products_ids_and_certifications_array."idCategoryMenu" = menu_with_production_time_lag_6."idCategoryMenu") AND (get_products_ids_and_certifications_array."idMealType" = menu_with_production_time_lag_6."idMealType") AND (get_products_ids_and_certifications_array."idDish" = menu_with_production_time_lag_6."idDish") AND (get_products_ids_and_certifications_array."idRecipeMenu" = menu_with_production_time_lag_6."idRecipeMenu"))
  • Rows Removed by Join Filter: 504
660. 0.006 0.006 ↓ 63.0 63 1

CTE Scan on menu_with_production_time_lag menu_with_production_time_lag_6 (cost=0.00..0.02 rows=1 width=28) (actual time=0.000..0.006 rows=63 loops=1)

661. 0.441 0.441 ↓ 9.0 9 63

CTE Scan on get_products_ids_and_certifications_array (cost=0.00..0.02 rows=1 width=140) (actual time=0.005..0.007 rows=9 loops=63)

662.          

CTE products_certifications_labels

663. 0.075 0.885 ↓ 35.0 35 1

GroupAggregate (cost=1.21..1.24 rows=1 width=80) (actual time=0.817..0.885 rows=35 loops=1)

  • Group Key: get_products_info_by_menu_element."idMenuElement", get_products_info_by_menu_element."idCertifications
664. 0.033 0.810 ↓ 70.0 70 1

Sort (cost=1.21..1.22 rows=1 width=158) (actual time=0.807..0.810 rows=70 loops=1)

  • Sort Key: get_products_info_by_menu_element."idMenuElement", get_products_info_by_menu_element."idCertifications
  • Sort Method: quicksort Memory: 33kB
665. 0.136 0.777 ↓ 70.0 70 1

Nested Loop (cost=0.00..1.20 rows=1 width=158) (actual time=0.377..0.777 rows=70 loops=1)

  • Join Filter: (ARRAY["Certification".id] <@ get_products_info_by_menu_element."idCertifications")
  • Rows Removed by Join Filter: 434
666. 0.578 0.578 ↓ 63.0 63 1

CTE Scan on get_products_info_by_menu_element (cost=0.00..0.02 rows=1 width=40) (actual time=0.367..0.578 rows=63 loops=1)

667. 0.063 0.063 ↑ 1.0 8 63

Seq Scan on "Certification" (cost=0.00..1.08 rows=8 width=122) (actual time=0.000..0.001 rows=8 loops=63)

668.          

CTE products_unnest

669. 0.026 0.031 ↓ 1.5 147 1

ProjectSet (cost=0.00..0.53 rows=100 width=12) (actual time=0.002..0.031 rows=147 loops=1)

670. 0.005 0.005 ↓ 63.0 63 1

CTE Scan on get_products_info_by_menu_element get_products_info_by_menu_element_1 (cost=0.00..0.02 rows=1 width=40) (actual time=0.000..0.005 rows=63 loops=1)

671.          

CTE products_labels

672. 0.052 0.211 ↓ 2.3 147 1

Hash Join (cost=3.25..23.88 rows=64 width=30) (actual time=0.102..0.211 rows=147 loops=1)

  • Hash Cond: ("Element_1".id = products_unnest."idProduct")
673. 0.083 0.083 ↑ 1.0 388 1

Seq Scan on "Element" "Element_1" (cost=0.00..18.54 rows=388 width=22) (actual time=0.010..0.083 rows=388 loops=1)

  • Filter: (type = ANY ('{1,2}'::integer[]))
  • Rows Removed by Filter: 215
674. 0.020 0.076 ↓ 1.5 147 1

Hash (cost=2.00..2.00 rows=100 width=12) (actual time=0.076..0.076 rows=147 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
675. 0.056 0.056 ↓ 1.5 147 1

CTE Scan on products_unnest (cost=0.00..2.00 rows=100 width=12) (actual time=0.003..0.056 rows=147 loops=1)

676.          

CTE products_labels_array

677. 0.139 0.489 ↓ 63.0 63 1

GroupAggregate (cost=1.57..1.60 rows=1 width=72) (actual time=0.354..0.489 rows=63 loops=1)

  • Group Key: products_labels."idMenuElement", get_products_info_by_menu_element_2."idProducts
678. 0.056 0.350 ↓ 147.0 147 1

Sort (cost=1.57..1.58 rows=1 width=358) (actual time=0.343..0.350 rows=147 loops=1)

  • Sort Key: products_labels."idMenuElement", get_products_info_by_menu_element_2."idProducts
  • Sort Method: quicksort Memory: 44kB
679. 0.037 0.294 ↓ 147.0 147 1

Hash Join (cost=0.03..1.56 rows=1 width=358) (actual time=0.131..0.294 rows=147 loops=1)

  • Hash Cond: (products_labels."idMenuElement" = get_products_info_by_menu_element_2."idMenuElement")
680. 0.240 0.240 ↓ 2.3 147 1

CTE Scan on products_labels (cost=0.00..1.28 rows=64 width=326) (actual time=0.103..0.240 rows=147 loops=1)

681. 0.010 0.017 ↓ 63.0 63 1

Hash (cost=0.02..0.02 rows=1 width=40) (actual time=0.017..0.017 rows=63 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
682. 0.007 0.007 ↓ 63.0 63 1

CTE Scan on get_products_info_by_menu_element get_products_info_by_menu_element_2 (cost=0.00..0.02 rows=1 width=40) (actual time=0.000..0.007 rows=63 loops=1)

683.          

CTE recipe_tags

684. 0.041 0.946 ↓ 35.0 70 1

Nested Loop (cost=0.21..3.39 rows=2 width=17) (actual time=0.814..0.946 rows=70 loops=1)

685. 0.038 0.835 ↓ 35.0 70 1

Hash Join (cost=0.07..2.89 rows=2 width=8) (actual time=0.799..0.835 rows=70 loops=1)

  • Hash Cond: ("Recipe_Tag"."idRecipe" = menu_computed_1."idRecipeMenu")
686. 0.017 0.017 ↑ 1.0 131 1

Seq Scan on "Recipe_Tag" (cost=0.00..2.31 rows=131 width=8) (actual time=0.007..0.017 rows=131 loops=1)

687. 0.013 0.780 ↓ 31.5 63 1

Hash (cost=0.04..0.04 rows=2 width=8) (actual time=0.780..0.780 rows=63 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
688. 0.767 0.767 ↓ 31.5 63 1

CTE Scan on menu_computed menu_computed_1 (cost=0.00..0.04 rows=2 width=8) (actual time=0.001..0.767 rows=63 loops=1)

689. 0.070 0.070 ↑ 1.0 1 70

Index Scan using "Tag_PK" on "Tag" (cost=0.14..0.25 rows=1 width=17) (actual time=0.001..0.001 rows=1 loops=70)

  • Index Cond: (id = "Recipe_Tag"."idTag")
690.          

CTE recipe_tags_array

691. 0.063 1.059 ↓ 4.5 9 1

GroupAggregate (cost=0.05..0.10 rows=2 width=36) (actual time=1.015..1.059 rows=9 loops=1)

  • Group Key: recipe_tags."idRecipe
692. 0.024 0.996 ↓ 35.0 70 1

Sort (cost=0.05..0.06 rows=2 width=122) (actual time=0.992..0.996 rows=70 loops=1)

  • Sort Key: recipe_tags."idRecipe
  • Sort Method: quicksort Memory: 28kB
693. 0.972 0.972 ↓ 35.0 70 1

CTE Scan on recipe_tags (cost=0.00..0.04 rows=2 width=122) (actual time=0.815..0.972 rows=70 loops=1)

694. 0.071 13.796 ↓ 52.5 105 1

Hash Left Join (cost=0.20..0.33 rows=2 width=3,127) (actual time=13.538..13.796 rows=105 loops=1)

  • Hash Cond: (menu_computed."idMenuElement" = allergen_info."idMenuElement")
695. 0.049 13.239 ↓ 31.5 63 1

Hash Left Join (cost=0.16..0.28 rows=2 width=2,917) (actual time=13.038..13.239 rows=63 loops=1)

  • Hash Cond: (menu_computed."idMenuElement" = allergen_labels."idMenuElement")
696. 0.042 12.802 ↓ 31.5 63 1

Hash Left Join (cost=0.13..0.23 rows=2 width=2,917) (actual time=12.637..12.802 rows=63 loops=1)

  • Hash Cond: (menu_computed."idElement" = recipe_tags_array."idRecipe")
697. 0.052 11.690 ↓ 31.5 63 1

Hash Left Join (cost=0.07..0.14 rows=2 width=2,885) (actual time=11.557..11.690 rows=63 loops=1)

  • Hash Cond: (menu_computed."idMenuElement" = products_labels_array."idMenuElement")
698. 0.087 11.115 ↓ 31.5 63 1

Hash Left Join (cost=0.03..0.09 rows=2 width=2,821) (actual time=11.025..11.115 rows=63 loops=1)

  • Hash Cond: (menu_computed."idMenuElement" = products_certifications_labels."idMenuElement")
699. 10.122 10.122 ↓ 31.5 63 1

CTE Scan on menu_computed (cost=0.00..0.04 rows=2 width=2,757) (actual time=10.105..10.122 rows=63 loops=1)

700. 0.010 0.906 ↓ 35.0 35 1

Hash (cost=0.02..0.02 rows=1 width=72) (actual time=0.905..0.906 rows=35 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
701. 0.896 0.896 ↓ 35.0 35 1

CTE Scan on products_certifications_labels (cost=0.00..0.02 rows=1 width=72) (actual time=0.818..0.896 rows=35 loops=1)

702. 0.016 0.523 ↓ 63.0 63 1

Hash (cost=0.02..0.02 rows=1 width=72) (actual time=0.523..0.523 rows=63 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 16kB
703. 0.507 0.507 ↓ 63.0 63 1

CTE Scan on products_labels_array (cost=0.00..0.02 rows=1 width=72) (actual time=0.355..0.507 rows=63 loops=1)

704. 0.005 1.070 ↓ 4.5 9 1

Hash (cost=0.04..0.04 rows=2 width=36) (actual time=1.070..1.070 rows=9 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
705. 1.065 1.065 ↓ 4.5 9 1

CTE Scan on recipe_tags_array (cost=0.00..0.04 rows=2 width=36) (actual time=1.017..1.065 rows=9 loops=1)

706. 0.009 0.388 ↓ 42.0 42 1

Hash (cost=0.02..0.02 rows=1 width=8) (actual time=0.388..0.388 rows=42 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
707. 0.379 0.379 ↓ 42.0 42 1

CTE Scan on allergen_labels (cost=0.00..0.02 rows=1 width=8) (actual time=0.289..0.379 rows=42 loops=1)

708. 0.018 0.486 ↓ 84.0 84 1

Hash (cost=0.02..0.02 rows=1 width=218) (actual time=0.486..0.486 rows=84 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
709. 0.468 0.468 ↓ 84.0 84 1

CTE Scan on allergen_info (cost=0.00..0.02 rows=1 width=218) (actual time=0.010..0.468 rows=84 loops=1)

Planning time : 33.556 ms
Execution time : 22.625 ms