explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OLjo

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

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

  • 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
2.          

CTE site_prod_param

3. 0.000 0.000 ↓ 0.0

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

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

CTE categorymenu_child

5. 0.000 0.000 ↓ 0.0

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

  • Hash Cond: (("RecipeVersion"."idTexture" = "CategoryMenu"."idTexture") AND ("RecipeVersion"."idSegment" = "CategoryMenu"."idSegment") AND ("RecipeVersion"."idDiet" = "CategoryMenu"."idDiet"))
6. 0.000 0.000 ↓ 0.0

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

7. 0.000 0.000 ↓ 0.0

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

8. 0.000 0.000 ↓ 0.0

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

  • Filter: (("isActive" IS TRUE) AND (id = 102))
9.          

CTE categorymenu

10. 0.000 0.000 ↓ 0.0

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

11.          

CTE categorymenuweek

12. 0.000 0.000 ↓ 0.0

Unique (cost=17.79..17.83 rows=6 width=10) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

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

  • Sort Key: "CategoryMenuWeek"."idCategoryMenu", "CategoryMenuWeek"."idMealType
14. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.28..17.71 rows=6 width=10) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

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

16. 0.000 0.000 ↓ 0.0

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

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

CTE nutrition_guideline

18. 0.000 0.000 ↓ 0.0

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

19. 0.000 0.000 ↓ 0.0

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

  • Filter: ("idCategoryMenu" = 102)
20.          

CTE nutrition_guideline_item

21. 0.000 0.000 ↓ 0.0

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

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

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

  • 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.000 0.000 ↓ 0.0

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

24. 0.000 0.000 ↓ 0.0

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

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

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

26.          

CTE menus_without_recipes

27. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.85..18.58 rows=5 width=583) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.71..17.67 rows=5 width=501) (actual rows= loops=)

  • 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.000 0.000 ↓ 0.0

Nested Loop (cost=0.71..17.38 rows=5 width=145) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

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

  • Join Filter: ("ClosedPeriod"."idSiteOwner" = categorymenu_1."idSiteOwner")
31. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..8.34 rows=1 width=43) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

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

33. 0.000 0.000 ↓ 0.0

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

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

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

  • Index Cond: ("dateValid" @> "Menu"."dateMenu")
35. 0.000 0.000 ↓ 0.0

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

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

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

37. 0.000 0.000 ↓ 0.0

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

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

CTE menus_without_false_element

39. 0.000 0.000 ↓ 0.0

CTE Scan on menus_without_recipes (cost=0.00..0.11 rows=2 width=583) (actual rows= loops=)

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

CTE menus_with_recipes

41. 0.000 0.000 ↓ 0.0

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

  • Join Filter: ("Recipe_Lifetime"."idRecipe" = menu_element_with_recipe."idRecipeMenu")
42. 0.000 0.000 ↓ 0.0

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

  • Join Filter: ("Recipe_ProductionWorkshop"."idRecipe" = menu_element_with_recipe."idRecipeMenu")
43. 0.000 0.000 ↓ 0.0

Hash Join (cost=20.52..20.57 rows=1 width=605) (actual rows= loops=)

  • 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.000 0.000 ↓ 0.0

CTE Scan on menus_without_false_element (cost=0.00..0.04 rows=2 width=583) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Hash (cost=20.48..20.48 rows=2 width=30) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Subquery Scan on menu_element_with_recipe (cost=20.45..20.48 rows=2 width=30) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

Unique (cost=20.45..20.46 rows=2 width=38) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Sort (cost=20.45..20.45 rows=2 width=38) (actual rows= loops=)

  • 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
49. 0.000 0.000 ↓ 0.0

Subquery Scan on element_with_potential_recipe (cost=0.19..20.44 rows=2 width=38) (actual rows= loops=)

  • 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.000 0.000 ↓ 0.0

ProjectSet (cost=0.19..17.44 rows=200 width=30) (actual rows= loops=)

51. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.19..16.43 rows=2 width=51) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

Unique (cost=0.05..0.07 rows=2 width=8) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

Sort (cost=0.05..0.06 rows=2 width=8) (actual rows= loops=)

  • Sort Key: menus_without_false_element_1."idElementRecipe", menus_without_false_element_1."idCategoryMenuVersion
54. 0.000 0.000 ↓ 0.0

CTE Scan on menus_without_false_element menus_without_false_element_1 (cost=0.00..0.04 rows=2 width=8) (actual rows= loops=)

55. 0.000 0.000 ↓ 0.0

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

  • Index Cond: ("idElement" = menus_without_false_element_1."idElementRecipe")
  • Filter: ("idRecipeVersions" && ARRAY[1, menus_without_false_element_1."idCategoryMenuVersion"])
56. 0.000 0.000 ↓ 0.0

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

  • Filter: ("idSiteOwner" = 9)
57. 0.000 0.000 ↓ 0.0

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

  • Filter: ("idSiteOwner" = 9)
58.          

CTE menu_with_production_time_lag

59. 0.000 0.000 ↓ 0.0

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

  • 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.000 0.000 ↓ 0.0

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

61. 0.000 0.000 ↓ 0.0

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

62. 0.000 0.000 ↓ 0.0

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

63.          

CTE site_with_parent

64. 0.000 0.000 ↓ 0.0

Nested Loop (cost=16.22..21.56 rows=1 width=16) (actual rows= loops=)

65. 0.000 0.000 ↓ 0.0

Nested Loop (cost=16.08..21.21 rows=1 width=20) (actual rows= loops=)

66. 0.000 0.000 ↓ 0.0

Hash Join (cost=15.93..20.87 rows=1 width=20) (actual rows= loops=)

  • 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))
67. 0.000 0.000 ↓ 0.0

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

68. 0.000 0.000 ↓ 0.0

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

69. 0.000 0.000 ↓ 0.0

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

  • Hash Cond: ((from_site_parent_tree."idSite" = root."idFromSite") AND (from_site_parent_tree."idTree" = root."idTreeFromSite"))
70. 0.000 0.000 ↓ 0.0

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

71. 0.000 0.000 ↓ 0.0

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

72. 0.000 0.000 ↓ 0.0

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

73. 0.000 0.000 ↓ 0.0

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

74. 0.000 0.000 ↓ 0.0

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

  • Sort Key: roots."idTree", roots."rightBorder
75. 0.000 0.000 ↓ 0.0

Nested Loop (cost=8.32..12.16 rows=1 width=24) (actual rows= loops=)

76. 0.000 0.000 ↓ 0.0

Hash Join (cost=8.17..11.13 rows=4 width=12) (actual rows= loops=)

  • Hash Cond: (roots."idSite" = "Site".id)
  • Join Filter: (("Site".type = 1) OR (roots."idSite" = roots."idSiteParent"))
77. 0.000 0.000 ↓ 0.0

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

78. 0.000 0.000 ↓ 0.0

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

79. 0.000 0.000 ↓ 0.0

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

80. 0.000 0.000 ↓ 0.0

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

  • Index Cond: (("idTree" = roots."idTree") AND ("idSite" = 9))
  • Filter: ((roots."leftBorder" <= "leftBorder") AND (roots."rightBorder" >= "rightBorder"))
81. 0.000 0.000 ↓ 0.0

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

  • Index Cond: (id = wished_site_parent_tree."idSite")
82. 0.000 0.000 ↓ 0.0

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

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

CTE site_root

84. 0.000 0.000 ↓ 0.0

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

  • Filter: (id = 9)
85.          

CTE production_and_consumption_date

86. 0.000 0.000 ↓ 0.0

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

87. 0.000 0.000 ↓ 0.0

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

88. 0.000 0.000 ↓ 0.0

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

89.          

CTE smartselection_rule

90. 0.000 0.000 ↓ 0.0

Append (cost=0.00..2.54 rows=2 width=184) (actual rows= loops=)

91. 0.000 0.000 ↓ 0.0

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

92. 0.000 0.000 ↓ 0.0

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

  • 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)))
93. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..1.27 rows=1 width=174) (actual rows= loops=)

  • 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))
94. 0.000 0.000 ↓ 0.0

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

95. 0.000 0.000 ↓ 0.0

Seq Scan on "SmartSelectionRule" (cost=0.00..1.21 rows=3 width=174) (actual rows= loops=)

  • Filter: ((status = 1) OR (status = 2) OR (status = 3))
96. 0.000 0.000 ↓ 0.0

CTE Scan on site_with_parent (cost=0.00..0.02 rows=1 width=6) (actual rows= loops=)

97. 0.000 0.000 ↓ 0.0

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

98. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..1.14 rows=1 width=52) (actual rows= loops=)

  • 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.000 0.000 ↓ 0.0

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

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

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

101.          

CTE distinct_category_menu

102. 0.000 0.000 ↓ 0.0

Unique (cost=0.03..0.04 rows=1 width=8) (actual rows= loops=)

103. 0.000 0.000 ↓ 0.0

Sort (cost=0.03..0.04 rows=1 width=8) (actual rows= loops=)

  • Sort Key: menu_with_production_time_lag_1."idCategoryMenu
104. 0.000 0.000 ↓ 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) (actual rows= loops=)

105.          

CTE category_menu_parents

106. 0.000 0.000 ↓ 0.0

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

107.          

CTE categorymenuparent

108. 0.000 0.000 ↓ 0.0

Recursive Union (cost=0.18..68.66 rows=81 width=12) (actual rows= loops=)

109. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.18..3.09 rows=1 width=12) (actual rows= loops=)

110. 0.000 0.000 ↓ 0.0

Hash Join (cost=0.03..2.76 rows=1 width=8) (actual rows= loops=)

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

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

112. 0.000 0.000 ↓ 0.0

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

113. 0.000 0.000 ↓ 0.0

CTE Scan on distinct_category_menu (cost=0.00..0.02 rows=1 width=4) (actual rows= loops=)

114. 0.000 0.000 ↓ 0.0

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

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

Nested Loop (cost=0.47..6.40 rows=8 width=12) (actual rows= loops=)

116. 0.000 0.000 ↓ 0.0

Hash Join (cost=0.33..3.14 rows=10 width=8) (actual rows= loops=)

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

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

118. 0.000 0.000 ↓ 0.0

Hash (cost=0.20..0.20 rows=10 width=8) (actual rows= loops=)

119. 0.000 0.000 ↓ 0.0

WorkTable Scan on categorymenuparent (cost=0.00..0.20 rows=10 width=8) (actual rows= loops=)

120. 0.000 0.000 ↓ 0.0

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

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

CTE product

122. 0.000 0.000 ↓ 0.0

Nested Loop (cost=14.51..21.92 rows=1 width=282) (actual rows= loops=)

123. 0.000 0.000 ↓ 0.0

Nested Loop (cost=14.36..21.43 rows=1 width=52) (actual rows= loops=)

124. 0.000 0.000 ↓ 0.0

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

125. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on "SupplierProductAllowedFlat" (cost=14.36..21.39 rows=2 width=52) (actual rows= loops=)

  • 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[]))
126. 0.000 0.000 ↓ 0.0

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

127. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on "SupplierProductAllowedFlat_dateValid" (cost=0.00..4.31 rows=22 width=0) (actual rows= loops=)

  • 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.000 0.000 ↓ 0.0

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

  • Index Cond: ("allowedSites" @> '{9}'::integer[])
129. 0.000 0.000 ↓ 0.0

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

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

CTE stable_production_period

131. 0.000 0.000 ↓ 0.0

Unique (cost=0.12..0.19 rows=3 width=36) (actual rows= loops=)

132. 0.000 0.000 ↓ 0.0

WindowAgg (cost=0.12..0.18 rows=3 width=36) (actual rows= loops=)

133. 0.000 0.000 ↓ 0.0

Sort (cost=0.12..0.13 rows=3 width=4) (actual rows= loops=)

  • Sort Key: (lower(product_1."dateValid"))
134. 0.000 0.000 ↓ 0.0

Append (cost=0.00..0.10 rows=3 width=4) (actual rows= loops=)

135. 0.000 0.000 ↓ 0.0

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

  • Filter: (lower("dateValid") <> '-infinity'::date)
136. 0.000 0.000 ↓ 0.0

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

137. 0.000 0.000 ↓ 0.0

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

138.          

CTE stable_consumption_period

139. 0.000 0.000 ↓ 0.0

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

140. 0.000 0.000 ↓ 0.0

WindowAgg (cost=0.19..0.27 rows=4 width=36) (actual rows= loops=)

141. 0.000 0.000 ↓ 0.0

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

  • Sort Key: (lower(smartselection_rule_1."dateValidRule"))
142. 0.000 0.000 ↓ 0.0

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

143. 0.000 0.000 ↓ 0.0

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

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

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

145. 0.000 0.000 ↓ 0.0

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

146.          

CTE recipe_only

147. 0.000 0.000 ↓ 0.0

Unique (cost=0.03..0.04 rows=1 width=4) (actual rows= loops=)

148. 0.000 0.000 ↓ 0.0

Sort (cost=0.03..0.04 rows=1 width=4) (actual rows= loops=)

  • Sort Key: menu_with_production_time_lag_2."idRecipeMenu
149. 0.000 0.000 ↓ 0.0

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

150.          

CTE recipe_component

151. 0.000 0.000 ↓ 0.0

WindowAgg (cost=15.48..15.59 rows=4 width=206) (actual rows= loops=)

152. 0.000 0.000 ↓ 0.0

Sort (cost=15.48..15.49 rows=4 width=130) (actual rows= loops=)

  • Sort Key: recipe_only."idRecipeMenu", "RecipeFlat"."idRecipeVersion", "RecipeFlat"."idSubRecipeOwner
153. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.31..15.44 rows=4 width=130) (actual rows= loops=)

154. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..0.05 rows=1 width=5) (actual rows= loops=)

155. 0.000 0.000 ↓ 0.0

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

156. 0.000 0.000 ↓ 0.0

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

157. 0.000 0.000 ↓ 0.0

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

  • Recheck Cond: ("idRecipe" = recipe_only."idRecipeMenu")
158. 0.000 0.000 ↓ 0.0

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

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

CTE menu_compressed

160. 0.000 0.000 ↓ 0.0

Unique (cost=0.26..0.28 rows=1 width=96) (actual rows= loops=)

161. 0.000 0.000 ↓ 0.0

Sort (cost=0.26..0.26 rows=1 width=96) (actual rows= loops=)

  • 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
162. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..0.25 rows=1 width=96) (actual rows= loops=)

  • Join Filter: (stable_consumption_period."dateStableConsumption" @> menu_with_production_time_lag_3."dateConsumption")
163. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..0.12 rows=1 width=68) (actual rows= loops=)

  • Join Filter: (stable_production_period."dateStableProduction" @> menu_with_production_time_lag_3."dateProduction")
164. 0.000 0.000 ↓ 0.0

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

  • Filter: (NOT "isExcludedRecipe")
165. 0.000 0.000 ↓ 0.0

CTE Scan on stable_production_period (cost=0.00..0.06 rows=3 width=32) (actual rows= loops=)

166. 0.000 0.000 ↓ 0.0

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

167.          

CTE menu_with_recipe_and_categorymenu

168. 0.000 0.000 ↓ 0.0

Unique (cost=0.18..0.21 rows=2 width=21) (actual rows= loops=)

169. 0.000 0.000 ↓ 0.0

Sort (cost=0.18..0.18 rows=2 width=21) (actual rows= loops=)

  • Sort Key: menu_compressed."idSiteOwner", menu_compressed."idRecipeMenu", menu_compressed."idGuest", menu_compressed."idMealType", menu_compressed."idCategoryMenu
170. 0.000 0.000 ↓ 0.0

Append (cost=0.00..0.17 rows=2 width=21) (actual rows= loops=)

171. 0.000 0.000 ↓ 0.0

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

172. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..0.13 rows=1 width=21) (actual rows= loops=)

  • Join Filter: ((menu_compressed_1."idRecipeMenu" = recipe_component."idRecipeMenu") AND ((recipe_component."idRecipeVersionMainParent" = menu_compressed_1."idCategoryMenuVersion") OR (recipe_component."idRecipeVersionMainParent" = 1)))
173. 0.000 0.000 ↓ 0.0

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

174. 0.000 0.000 ↓ 0.0

CTE Scan on recipe_component (cost=0.00..0.09 rows=1 width=13) (actual rows= loops=)

  • Filter: (type = 3)
175.          

CTE sites_list_descendant_and_ancestor

176. 0.000 0.000 ↓ 0.0

Append (cost=10.86..51.09 rows=56 width=24) (actual rows= loops=)

177. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10.86..25.13 rows=28 width=24) (actual rows= loops=)

178. 0.000 0.000 ↓ 0.0

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

  • Filter: (id = 9)
179. 0.000 0.000 ↓ 0.0

Hash Join (cost=10.86..18.08 rows=28 width=24) (actual rows= loops=)

  • Hash Cond: (wished_site_1.id = wished_site_parent_tree_1."idSite")
180. 0.000 0.000 ↓ 0.0

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

181. 0.000 0.000 ↓ 0.0

Hash (cost=10.51..10.51 rows=28 width=24) (actual rows= loops=)

182. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..10.51 rows=28 width=24) (actual rows= loops=)

  • 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"))
183. 0.000 0.000 ↓ 0.0

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

  • Filter: ("idTree" = '1'::smallint)
184. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..3.33 rows=2 width=14) (actual rows= loops=)

185. 0.000 0.000 ↓ 0.0

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

  • Filter: (("idTree" = '1'::smallint) AND ("idSite" = 9))
186. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10.86..25.13 rows=28 width=24) (actual rows= loops=)

187. 0.000 0.000 ↓ 0.0

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

  • Filter: (id = 9)
188. 0.000 0.000 ↓ 0.0

Hash Join (cost=10.86..18.08 rows=28 width=24) (actual rows= loops=)

  • Hash Cond: (wished_site_2.id = wished_site_parent_tree_2."idSite")
189. 0.000 0.000 ↓ 0.0

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

190. 0.000 0.000 ↓ 0.0

Hash (cost=10.51..10.51 rows=28 width=24) (actual rows= loops=)

191. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..10.51 rows=28 width=24) (actual rows= loops=)

  • 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"))
192. 0.000 0.000 ↓ 0.0

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

  • Filter: ("idTree" = '1'::smallint)
193. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..3.33 rows=2 width=14) (actual rows= loops=)

194. 0.000 0.000 ↓ 0.0

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

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

CTE menu_with_recipe_and_categorymenu_with_criterias

196. 0.000 0.000 ↓ 0.0

Hash Join (cost=16.46..17.81 rows=2 width=43) (actual rows= loops=)

  • Hash Cond: (sites_list_descendant_and_ancestor."idSite" = "Recipe_1"."_idSiteOwner")
197. 0.000 0.000 ↓ 0.0

CTE Scan on sites_list_descendant_and_ancestor (cost=0.00..1.12 rows=56 width=14) (actual rows= loops=)

198. 0.000 0.000 ↓ 0.0

Hash (cost=16.43..16.43 rows=2 width=33) (actual rows= loops=)

199. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.15..16.43 rows=2 width=33) (actual rows= loops=)

200. 0.000 0.000 ↓ 0.0

CTE Scan on menu_with_recipe_and_categorymenu (cost=0.00..0.04 rows=2 width=21) (actual rows= loops=)

201. 0.000 0.000 ↓ 0.0

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

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

CTE smart_recipe_to_analyse

203. 0.000 0.000 ↓ 0.0

Unique (cost=0.05..0.08 rows=2 width=16) (actual rows= loops=)

204. 0.000 0.000 ↓ 0.0

Sort (cost=0.05..0.06 rows=2 width=16) (actual rows= loops=)

  • 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
205. 0.000 0.000 ↓ 0.0

CTE Scan on menu_with_recipe_and_categorymenu_with_criterias (cost=0.00..0.04 rows=2 width=16) (actual rows= loops=)

206.          

CTE smartbasisweight_flat_pre

207. 0.000 0.000 ↓ 0.0

ProjectSet (cost=0.00..5.16 rows=800 width=36) (actual rows= loops=)

208. 0.000 0.000 ↓ 0.0

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

209.          

CTE simplified_criteria

210. 0.000 0.000 ↓ 0.0

Unique (cost=54.58..60.58 rows=200 width=8) (actual rows= loops=)

211. 0.000 0.000 ↓ 0.0

Sort (cost=54.58..56.58 rows=800 width=8) (actual rows= loops=)

  • Sort Key: smartbasisweight_flat_pre."idSmartRule", smartbasisweight_flat_pre."idColumn
212. 0.000 0.000 ↓ 0.0

CTE Scan on smartbasisweight_flat_pre (cost=0.00..16.00 rows=800 width=8) (actual rows= loops=)

213.          

CTE smartbasisweight_flat

214. 0.000 0.000 ↓ 0.0

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

215. 0.000 0.000 ↓ 0.0

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

216. 0.000 0.000 ↓ 0.0

Unique (cost=44.35..46.35 rows=200 width=36) (actual rows= loops=)

217. 0.000 0.000 ↓ 0.0

Sort (cost=44.35..45.35 rows=400 width=36) (actual rows= loops=)

  • Sort Key: id_table."idSmartRule
218. 0.000 0.000 ↓ 0.0

Hash Anti Join (cost=4.51..27.06 rows=400 width=36) (actual rows= loops=)

  • Hash Cond: (id_table."idSmartRule" = guest_table."idSmartRule")
219. 0.000 0.000 ↓ 0.0

CTE Scan on smartbasisweight_flat_pre id_table (cost=0.00..16.00 rows=800 width=28) (actual rows= loops=)

220. 0.000 0.000 ↓ 0.0

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

221. 0.000 0.000 ↓ 0.0

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

  • Filter: ("idColumn" = 6)
222. 0.000 0.000 ↓ 0.0

Unique (cost=44.35..46.35 rows=200 width=36) (actual rows= loops=)

223. 0.000 0.000 ↓ 0.0

Sort (cost=44.35..45.35 rows=400 width=36) (actual rows= loops=)

  • Sort Key: id_table_1."idSmartRule
224. 0.000 0.000 ↓ 0.0

Hash Anti Join (cost=4.51..27.06 rows=400 width=36) (actual rows= loops=)

  • Hash Cond: (id_table_1."idSmartRule" = mealtype_table."idSmartRule")
225. 0.000 0.000 ↓ 0.0

CTE Scan on smartbasisweight_flat_pre id_table_1 (cost=0.00..16.00 rows=800 width=28) (actual rows= loops=)

226. 0.000 0.000 ↓ 0.0

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

227. 0.000 0.000 ↓ 0.0

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

  • Filter: ("idColumn" = 7)
228. 0.000 0.000 ↓ 0.0

Unique (cost=44.35..46.35 rows=200 width=36) (actual rows= loops=)

229. 0.000 0.000 ↓ 0.0

Sort (cost=44.35..45.35 rows=400 width=36) (actual rows= loops=)

  • Sort Key: id_table_2."idSmartRule
230. 0.000 0.000 ↓ 0.0

Hash Anti Join (cost=4.51..27.06 rows=400 width=36) (actual rows= loops=)

  • Hash Cond: (id_table_2."idSmartRule" = recipe_table."idSmartRule")
231. 0.000 0.000 ↓ 0.0

CTE Scan on smartbasisweight_flat_pre id_table_2 (cost=0.00..16.00 rows=800 width=28) (actual rows= loops=)

232. 0.000 0.000 ↓ 0.0

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

233. 0.000 0.000 ↓ 0.0

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

  • Filter: ("idColumn" = 8)
234. 0.000 0.000 ↓ 0.0

Unique (cost=44.35..46.35 rows=200 width=36) (actual rows= loops=)

235. 0.000 0.000 ↓ 0.0

Sort (cost=44.35..45.35 rows=400 width=36) (actual rows= loops=)

  • Sort Key: id_table_3."idSmartRule
236. 0.000 0.000 ↓ 0.0

Hash Anti Join (cost=4.51..27.06 rows=400 width=36) (actual rows= loops=)

  • Hash Cond: (id_table_3."idSmartRule" = recipefamily_table."idSmartRule")
237. 0.000 0.000 ↓ 0.0

CTE Scan on smartbasisweight_flat_pre id_table_3 (cost=0.00..16.00 rows=800 width=28) (actual rows= loops=)

238. 0.000 0.000 ↓ 0.0

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

239. 0.000 0.000 ↓ 0.0

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

  • Filter: ("idColumn" = 9)
240. 0.000 0.000 ↓ 0.0

Unique (cost=44.35..46.35 rows=200 width=36) (actual rows= loops=)

241. 0.000 0.000 ↓ 0.0

Sort (cost=44.35..45.35 rows=400 width=36) (actual rows= loops=)

  • Sort Key: id_table_4."idSmartRule
242. 0.000 0.000 ↓ 0.0

Hash Anti Join (cost=4.51..27.06 rows=400 width=36) (actual rows= loops=)

  • Hash Cond: (id_table_4."idSmartRule" = site_table."idSmartRule")
243. 0.000 0.000 ↓ 0.0

CTE Scan on smartbasisweight_flat_pre id_table_4 (cost=0.00..16.00 rows=800 width=28) (actual rows= loops=)

244. 0.000 0.000 ↓ 0.0

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

245. 0.000 0.000 ↓ 0.0

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

  • Filter: ("idColumn" = 25)
246.          

CTE smartbasisweight_flat_filtered

247. 0.000 0.000 ↓ 0.0

Unique (cost=62.15..62.17 rows=1 width=36) (actual rows= loops=)

248. 0.000 0.000 ↓ 0.0

Sort (cost=62.15..62.16 rows=1 width=36) (actual rows= loops=)

  • Sort Key: smartbasisweight_flat."idSmartRule", smartbasisweight_flat."idColumn", smartbasisweight_flat."idCriteria", smartbasisweight_flat."idSiteOwner", smartbasisweight_flat.variation, smartbasisweight_flat.type, smartbasisweight_flat."dateUpdated
249. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..62.14 rows=1 width=36) (actual rows= loops=)

  • 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))))
250. 0.000 0.000 ↓ 0.0

CTE Scan on smart_recipe_to_analyse (cost=0.00..0.04 rows=2 width=16) (actual rows= loops=)

251. 0.000 0.000 ↓ 0.0

CTE Scan on smartbasisweight_flat (cost=0.00..58.50 rows=45 width=36) (actual rows= loops=)

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

CTE constructed_smart_rules

253. 0.000 0.000 ↓ 0.0

Unique (cost=1.56..1.59 rows=1 width=46) (actual rows= loops=)

254. 0.000 0.000 ↓ 0.0

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

  • 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
255. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.07..1.55 rows=1 width=46) (actual rows= loops=)

  • Join Filter: (guest_table_1."idSmartRule" = recipefamily_table_1."idSmartRule")
256. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.07..1.51 rows=1 width=62) (actual rows= loops=)

  • Join Filter: (guest_table_1."idSmartRule" = recipe_table_1."idSmartRule")
257. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.07..1.48 rows=1 width=54) (actual rows= loops=)

  • Join Filter: (guest_table_1."idSmartRule" = mealtype_table_1."idSmartRule")
258. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.07..1.44 rows=1 width=46) (actual rows= loops=)

  • Join Filter: (id_table_5."idSmartRule" = guest_table_1."idSmartRule")
259. 0.000 0.000 ↓ 0.0

Hash Join (cost=0.07..1.41 rows=1 width=38) (actual rows= loops=)

  • Hash Cond: (sites_list_descendant_and_ancestor_1."idSite" = COALESCE(site_table_1."idCriteria", id_table_5."idSiteOwner"))
260. 0.000 0.000 ↓ 0.0

CTE Scan on sites_list_descendant_and_ancestor sites_list_descendant_and_ancestor_1 (cost=0.00..1.12 rows=56 width=6) (actual rows= loops=)

261. 0.000 0.000 ↓ 0.0

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

262. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..0.05 rows=1 width=36) (actual rows= loops=)

  • Join Filter: (id_table_5."idSmartRule" = site_table_1."idSmartRule")
263. 0.000 0.000 ↓ 0.0

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

264. 0.000 0.000 ↓ 0.0

CTE Scan on smartbasisweight_flat_filtered site_table_1 (cost=0.00..0.02 rows=1 width=8) (actual rows= loops=)

  • Filter: ("idColumn" = 25)
265. 0.000 0.000 ↓ 0.0

CTE Scan on smartbasisweight_flat_filtered guest_table_1 (cost=0.00..0.02 rows=1 width=8) (actual rows= loops=)

  • Filter: ("idColumn" = 6)
266. 0.000 0.000 ↓ 0.0

CTE Scan on smartbasisweight_flat_filtered mealtype_table_1 (cost=0.00..0.02 rows=1 width=8) (actual rows= loops=)

  • Filter: ("idColumn" = 7)
267. 0.000 0.000 ↓ 0.0

CTE Scan on smartbasisweight_flat_filtered recipe_table_1 (cost=0.00..0.02 rows=1 width=8) (actual rows= loops=)

  • Filter: ("idColumn" = 8)
268. 0.000 0.000 ↓ 0.0

CTE Scan on smartbasisweight_flat_filtered recipefamily_table_1 (cost=0.00..0.02 rows=1 width=8) (actual rows= loops=)

  • Filter: ("idColumn" = 9)
269.          

CTE smart_full

270. 0.000 0.000 ↓ 0.0

Append (cost=3.95..4.02 rows=2 width=46) (actual rows= loops=)

271. 0.000 0.000 ↓ 0.0

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

272. 0.000 0.000 ↓ 0.0

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

273. 0.000 0.000 ↓ 0.0

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

  • Sort Key: "BasisWeight"."idMealType", "BasisWeight"."idRecipe", "BasisWeight"."idGuest", "BasisWeight"."idSite
274. 0.000 0.000 ↓ 0.0

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

  • Hash Cond: (sites_list_descendant_and_ancestor_2."idSite" = "BasisWeight"."idSite")
275. 0.000 0.000 ↓ 0.0

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

276. 0.000 0.000 ↓ 0.0

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

277. 0.000 0.000 ↓ 0.0

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

  • 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)))
278. 0.000 0.000 ↓ 0.0

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

279. 0.000 0.000 ↓ 0.0

Hash (cost=0.04..0.04 rows=2 width=8) (actual rows= loops=)

280. 0.000 0.000 ↓ 0.0

CTE Scan on smart_recipe_to_analyse smart_recipe_to_analyse_1 (cost=0.00..0.04 rows=2 width=8) (actual rows= loops=)

281. 0.000 0.000 ↓ 0.0

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

282.          

CTE smart_fix_conflict

283. 0.000 0.000 ↓ 0.0

Unique (cost=0.05..0.08 rows=2 width=46) (actual rows= loops=)

284. 0.000 0.000 ↓ 0.0

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

  • Sort Key: smart_full."idRecipe", smart_full."idGuest", smart_full."idMealType", smart_full."idRecipeFamily", smart_full."idSiteOwner", smart_full."dateUpdated" DESC
285. 0.000 0.000 ↓ 0.0

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

286.          

CTE recipe_basisweight_for_site

287. 0.000 0.000 ↓ 0.0

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

288.          

CTE basisweight_with_site

289. 0.000 0.000 ↓ 0.0

Hash Join (cost=0.07..1.42 rows=2 width=42) (actual rows= loops=)

  • Hash Cond: (site."idSite" = recipe_basisweight_for_site."idSite")
290. 0.000 0.000 ↓ 0.0

CTE Scan on sites_list_descendant_and_ancestor site (cost=0.00..1.12 rows=56 width=14) (actual rows= loops=)

291. 0.000 0.000 ↓ 0.0

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

292. 0.000 0.000 ↓ 0.0

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

293.          

CTE basisweight_recipe_with_site

294. 0.000 0.000 ↓ 0.0

Hash Join (cost=0.07..1.43 rows=1 width=72) (actual rows= loops=)

  • 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.000 0.000 ↓ 0.0

CTE Scan on sites_list_descendant_and_ancestor sites_list_descendant_and_ancestor_3 (cost=0.00..1.12 rows=56 width=14) (actual rows= loops=)

296. 0.000 0.000 ↓ 0.0

Hash (cost=0.04..0.04 rows=2 width=62) (actual rows= loops=)

297. 0.000 0.000 ↓ 0.0

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 rows= loops=)

298.          

CTE fast_recipe_with_basisweight

299. 0.000 0.000 ↓ 0.0

Append (cost=0.00..2.24 rows=16 width=62) (actual rows= loops=)

300. 0.000 0.000 ↓ 0.0

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

  • 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"))
301. 0.000 0.000 ↓ 0.0

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

302. 0.000 0.000 ↓ 0.0

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

303. 0.000 0.000 ↓ 0.0

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

  • 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"))
304. 0.000 0.000 ↓ 0.0

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

  • Filter: ("idRecipeFamily" = '-1'::integer)
305. 0.000 0.000 ↓ 0.0

CTE Scan on basisweight_recipe_with_site basisweight_recipe_with_site_1 (cost=0.00..0.02 rows=1 width=64) (actual rows= loops=)

306. 0.000 0.000 ↓ 0.0

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

  • 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"))
307. 0.000 0.000 ↓ 0.0

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

  • Filter: ("idMealType" = 0)
308. 0.000 0.000 ↓ 0.0

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

309. 0.000 0.000 ↓ 0.0

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

  • 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"))
310. 0.000 0.000 ↓ 0.0

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

  • Filter: (("idMealType" = 0) AND ("idRecipeFamily" = '-1'::integer))
311. 0.000 0.000 ↓ 0.0

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

312. 0.000 0.000 ↓ 0.0

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

  • 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"))
313. 0.000 0.000 ↓ 0.0

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

  • Filter: ("idRecipe" = '-1'::integer)
314. 0.000 0.000 ↓ 0.0

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

315. 0.000 0.000 ↓ 0.0

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

  • 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"))
316. 0.000 0.000 ↓ 0.0

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

  • Filter: (("idRecipe" = '-1'::integer) AND ("idRecipeFamily" = '-1'::integer))
317. 0.000 0.000 ↓ 0.0

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

318. 0.000 0.000 ↓ 0.0

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

  • 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"))
319. 0.000 0.000 ↓ 0.0

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

  • Filter: (("idRecipe" = '-1'::integer) AND ("idMealType" = 0))
320. 0.000 0.000 ↓ 0.0

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

321. 0.000 0.000 ↓ 0.0

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

  • 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.000 0.000 ↓ 0.0

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

  • Filter: (("idRecipe" = '-1'::integer) AND ("idRecipeFamily" = '-1'::integer) AND ("idMealType" = 0))
323. 0.000 0.000 ↓ 0.0

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

324. 0.000 0.000 ↓ 0.0

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

  • 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.000 0.000 ↓ 0.0

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

  • Filter: ("idGuest" = '-1'::integer)
326. 0.000 0.000 ↓ 0.0

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

327. 0.000 0.000 ↓ 0.0

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

  • 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.000 0.000 ↓ 0.0

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

  • Filter: (("idGuest" = '-1'::integer) AND ("idRecipeFamily" = '-1'::integer))
329. 0.000 0.000 ↓ 0.0

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

330. 0.000 0.000 ↓ 0.0

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

  • 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

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

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

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

333. 0.000 0.000 ↓ 0.0

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

  • 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.000 0.000 ↓ 0.0

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

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

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

336. 0.000 0.000 ↓ 0.0

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

  • 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.000 0.000 ↓ 0.0

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

  • Filter: (("idGuest" = '-1'::integer) AND ("idRecipe" = '-1'::integer))
338. 0.000 0.000 ↓ 0.0

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

339. 0.000 0.000 ↓ 0.0

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

  • 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

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

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

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

342. 0.000 0.000 ↓ 0.0

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

  • 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.000 0.000 ↓ 0.0

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

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

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

345. 0.000 0.000 ↓ 0.0

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

  • 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.000 0.000 ↓ 0.0

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

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

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

348.          

CTE categorymenu_recipe_with_basisweight

349. 0.000 0.000 ↓ 0.0

Unique (cost=0.64..0.84 rows=16 width=62) (actual rows= loops=)

350. 0.000 0.000 ↓ 0.0

Sort (cost=0.64..0.68 rows=16 width=62) (actual rows= loops=)

  • 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
351. 0.000 0.000 ↓ 0.0

CTE Scan on fast_recipe_with_basisweight (cost=0.00..0.32 rows=16 width=62) (actual rows= loops=)

352.          

CTE menu_basisweight_with_null

353. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=0.08..0.65 rows=2 width=53) (actual rows= loops=)

  • 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. 0.000 0.000 ↓ 0.0

CTE Scan on categorymenu_recipe_with_basisweight (cost=0.00..0.32 rows=16 width=44) (actual rows= loops=)

355. 0.000 0.000 ↓ 0.0

Hash (cost=0.04..0.04 rows=2 width=21) (actual rows= loops=)

356. 0.000 0.000 ↓ 0.0

CTE Scan on menu_with_recipe_and_categorymenu menu_with_recipe_and_categorymenu_1 (cost=0.00..0.04 rows=2 width=21) (actual rows= loops=)

357.          

CTE menu_basisweight

358. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.15..16.43 rows=2 width=85) (actual rows= loops=)

359. 0.000 0.000 ↓ 0.0

CTE Scan on menu_basisweight_with_null (cost=0.00..0.04 rows=2 width=53) (actual rows= loops=)

360. 0.000 0.000 ↓ 0.0

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

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

CTE menu_component_prepare_ratio_without_parent

362. 0.000 0.000 ↓ 0.0

WindowAgg (cost=0.00..0.23 rows=1 width=485) (actual rows= loops=)

363. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..0.20 rows=1 width=449) (actual rows= loops=)

  • 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"))
364. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..0.17 rows=1 width=367) (actual rows= loops=)

  • Join Filter: ((menu_basisweight."idRecipe" = recipe_component_1."idSubRecipeOwner") AND ((recipe_component_1."idRecipeVersionMainParent" = menu_basisweight."idCategoryMenuVersion") OR (recipe_component_1."idRecipeVersionMainParent" = 1)))
365. 0.000 0.000 ↓ 0.0

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

  • Filter: (type = 1)
366. 0.000 0.000 ↓ 0.0

CTE Scan on menu_basisweight (cost=0.00..0.04 rows=2 width=51) (actual rows= loops=)

367. 0.000 0.000 ↓ 0.0

CTE Scan on menu_compressed menu_compressed_2 (cost=0.00..0.02 rows=1 width=96) (actual rows= loops=)

368.          

CTE menu_component_prepare_ratio

369. 0.000 0.000 ↓ 0.0

Append (cost=0.15..8.34 rows=2 width=517) (actual rows= loops=)

370. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.15..8.29 rows=1 width=517) (actual rows= loops=)

  • Join Filter: (menu_basisweight_parent."idRecipe" = "Recipe_3".id)
371. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..0.10 rows=1 width=521) (actual rows= loops=)

  • 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"))
372. 0.000 0.000 ↓ 0.0

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

  • Filter: ("idSubRecipeOwner" <> "idRecipeMenu")
373. 0.000 0.000 ↓ 0.0

CTE Scan on menu_basisweight menu_basisweight_parent (cost=0.00..0.04 rows=2 width=46) (actual rows= loops=)

374. 0.000 0.000 ↓ 0.0

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

  • Index Cond: (id = menu_component_prepare_ratio_without_parent."idRecipeMenu")
375. 0.000 0.000 ↓ 0.0

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

376. 0.000 0.000 ↓ 0.0

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 rows= loops=)

  • Filter: ("idSubRecipeOwner" = "idRecipeMenu")
377.          

CTE menu_component_with_ratio_result

378. 0.000 0.000 ↓ 0.0

Append (cost=0.00..0.17 rows=2 width=484) (actual rows= loops=)

379. 0.000 0.000 ↓ 0.0

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

380. 0.000 0.000 ↓ 0.0

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

  • Filter: (("idProductionUnit" <> 1) OR (("idProductionUnit" = 1) AND ("weightPerPiece" = '0'::numeric)))
381. 0.000 0.000 ↓ 0.0

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

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

CTE menu_component

383. 0.000 0.000 ↓ 0.0

CTE Scan on menu_component_with_ratio_result (cost=0.00..0.07 rows=2 width=452) (actual rows= loops=)

384.          

CTE unnested_smartselection_rules

385. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..4.04 rows=200 width=200) (actual rows= loops=)

386. 0.000 0.000 ↓ 0.0

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

387. 0.000 0.000 ↓ 0.0

Function Scan on x (cost=0.01..1.00 rows=100 width=16) (actual rows= loops=)

388.          

CTE only_rules_on_category_menu

389. 0.000 0.000 ↓ 0.0

CTE Scan on unnested_smartselection_rules (cost=0.00..5.00 rows=1 width=56) (actual rows= loops=)

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

CTE category_menu_parent_of_applied_rule

391. 0.000 0.000 ↓ 0.0

Unique (cost=1.98..1.99 rows=1 width=56) (actual rows= loops=)

392. 0.000 0.000 ↓ 0.0

Sort (cost=1.98..1.98 rows=1 width=56) (actual rows= loops=)

  • 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

Hash Join (cost=0.03..1.97 rows=1 width=56) (actual rows= loops=)

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

CTE Scan on category_menu_parents (cost=0.00..1.62 rows=81 width=8) (actual rows= loops=)

395. 0.000 0.000 ↓ 0.0

Hash (cost=0.02..0.02 rows=1 width=52) (actual rows= loops=)

396. 0.000 0.000 ↓ 0.0

CTE Scan on only_rules_on_category_menu (cost=0.00..0.02 rows=1 width=52) (actual rows= loops=)

397.          

CTE precomputed_smartselection

398. 0.000 0.000 ↓ 0.0

WindowAgg (cost=11.64..20.14 rows=200 width=216) (actual rows= loops=)

399. 0.000 0.000 ↓ 0.0

WindowAgg (cost=11.64..16.14 rows=200 width=208) (actual rows= loops=)

400. 0.000 0.000 ↓ 0.0

Sort (cost=11.64..12.14 rows=200 width=200) (actual rows= loops=)

  • Sort Key: unnested_smartselection_rules_1."idSmartSelectionRule", unnested_smartselection_rules_1."applyToIndex
401. 0.000 0.000 ↓ 0.0

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

402.          

CTE checked_smartselection_rule

403. 0.000 0.000 ↓ 0.0

Append (cost=0.00..71.29 rows=14 width=346) (actual rows= loops=)

404. 0.000 0.000 ↓ 0.0

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

405. 0.000 0.000 ↓ 0.0

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

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

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

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

CTE Scan on menu_component (cost=0.00..0.04 rows=2 width=142) (actual rows= loops=)

408. 0.000 0.000 ↓ 0.0

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

409. 0.000 0.000 ↓ 0.0

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

  • 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.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..5.07 rows=1 width=350) (actual rows= loops=)

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

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

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

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

413. 0.000 0.000 ↓ 0.0

CTE Scan on category_menu_parent_of_applied_rule (cost=0.00..0.02 rows=1 width=40) (actual rows= loops=)

414. 0.000 0.000 ↓ 0.0

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

415. 0.000 0.000 ↓ 0.0

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

  • 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

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

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

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

418. 0.000 0.000 ↓ 0.0

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

419. 0.000 0.000 ↓ 0.0

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

  • 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

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

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

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

422. 0.000 0.000 ↓ 0.0

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

423. 0.000 0.000 ↓ 0.0

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

  • 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

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

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

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

426. 0.000 0.000 ↓ 0.0

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

427. 0.000 0.000 ↓ 0.0

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

  • 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

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

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

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

430. 0.000 0.000 ↓ 0.0

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

431. 0.000 0.000 ↓ 0.0

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

  • 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

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

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

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

434. 0.000 0.000 ↓ 0.0

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

435. 0.000 0.000 ↓ 0.0

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

  • 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

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

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

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

438. 0.000 0.000 ↓ 0.0

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

439. 0.000 0.000 ↓ 0.0

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

  • 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

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

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

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

442. 0.000 0.000 ↓ 0.0

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

443. 0.000 0.000 ↓ 0.0

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

  • 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

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

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

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

446. 0.000 0.000 ↓ 0.0

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

447. 0.000 0.000 ↓ 0.0

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

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

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

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

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

450. 0.000 0.000 ↓ 0.0

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

451. 0.000 0.000 ↓ 0.0

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

  • 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

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

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

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

454. 0.000 0.000 ↓ 0.0

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

455. 0.000 0.000 ↓ 0.0

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

  • 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

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

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

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

458. 0.000 0.000 ↓ 0.0

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

459. 0.000 0.000 ↓ 0.0

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

  • 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

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

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

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

462.          

CTE resolved_smartselection_rule_or

463. 0.000 0.000 ↓ 0.0

Unique (cost=0.55..0.69 rows=14 width=346) (actual rows= loops=)

464. 0.000 0.000 ↓ 0.0

Sort (cost=0.55..0.58 rows=14 width=346) (actual rows= loops=)

  • Sort Key: checked_smartselection_rule."idSmartSelectionRule", checked_smartselection_rule."andGroupIndex", checked_smartselection_rule."rowNumberMenuComponent
465. 0.000 0.000 ↓ 0.0

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

466.          

CTE resolved_smartselection_rule_and

467. 0.000 0.000 ↓ 0.0

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

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

WindowAgg (cost=0.55..1.00 rows=14 width=370) (actual rows= loops=)

469. 0.000 0.000 ↓ 0.0

Sort (cost=0.55..0.58 rows=14 width=326) (actual rows= loops=)

  • Sort Key: resolved_smartselection_rule_or."idSmartSelectionRule", resolved_smartselection_rule_or."rowNumberMenuComponent", resolved_smartselection_rule_or."dateStableConsumption
470. 0.000 0.000 ↓ 0.0

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

471.          

CTE component_rule

472. 0.000 0.000 ↓ 0.0

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

473. 0.000 0.000 ↓ 0.0

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

  • 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
474. 0.000 0.000 ↓ 0.0

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

475. 0.000 0.000 ↓ 0.0

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

  • 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
476. 0.000 0.000 ↓ 0.0

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

477.          

CTE component_no_rule

478. 0.000 0.000 ↓ 0.0

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

  • Hash Cond: (menu_component_14."rowNumberMenuComponent" = resolved_smartselection_rule_and_1."rowNumberMenuComponent")
  • Filter: (resolved_smartselection_rule_and_1."idSmartSelectionRule" IS NULL)
479. 0.000 0.000 ↓ 0.0

CTE Scan on menu_component menu_component_14 (cost=0.00..0.04 rows=2 width=138) (actual rows= loops=)

480. 0.000 0.000 ↓ 0.0

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

481. 0.000 0.000 ↓ 0.0

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

482.          

CTE component_compressed

483. 0.000 0.000 ↓ 0.0

Unique (cost=0.11..0.21 rows=2 width=262) (actual rows= loops=)

484. 0.000 0.000 ↓ 0.0

WindowAgg (cost=0.11..0.17 rows=2 width=262) (actual rows= loops=)

485. 0.000 0.000 ↓ 0.0

Sort (cost=0.11..0.11 rows=2 width=234) (actual rows= loops=)

  • Sort Key: sub_1."dateStableConsumption", sub_1."dateStableProduction", sub_1."idSmartSelectionRule", sub_1."idGeneric", sub_1."idProductionUnit", sub_1."weightPerPieceTarget", sub_1."choiceNumber
486. 0.000 0.000 ↓ 0.0

Subquery Scan on sub_1 (cost=0.00..0.10 rows=2 width=234) (actual rows= loops=)

487. 0.000 0.000 ↓ 0.0

Append (cost=0.00..0.07 rows=2 width=330) (actual rows= loops=)

488. 0.000 0.000 ↓ 0.0

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

489. 0.000 0.000 ↓ 0.0

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

490. 0.000 0.000 ↓ 0.0

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

491.          

CTE product_unnested

492. 0.000 0.000 ↓ 0.0

ProjectSet (cost=0.00..0.53 rows=100 width=519) (actual rows= loops=)

493. 0.000 0.000 ↓ 0.0

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

494.          

CTE smart_selection_temp

495. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=0.07..3.15 rows=2 width=711) (actual rows= loops=)

  • Hash Cond: (product_3."idGenericUn" = component_compressed."idGeneric")
  • Join Filter: (product_3."dateValid" @> component_compressed."dateStableProduction")
496. 0.000 0.000 ↓ 0.0

CTE Scan on product_unnested product_3 (cost=0.00..2.00 rows=100 width=519) (actual rows= loops=)

497. 0.000 0.000 ↓ 0.0

Hash (cost=0.04..0.04 rows=2 width=254) (actual rows= loops=)

498. 0.000 0.000 ↓ 0.0

CTE Scan on component_compressed (cost=0.00..0.04 rows=2 width=254) (actual rows= loops=)

499.          

CTE smart_selection_unnest

500. 0.000 0.000 ↓ 0.0

WindowAgg (cost=0.00..6.05 rows=200 width=583) (actual rows= loops=)

501. 0.000 0.000 ↓ 0.0

ProjectSet (cost=0.00..1.05 rows=200 width=579) (actual rows= loops=)

502. 0.000 0.000 ↓ 0.0

CTE Scan on smart_selection_temp (cost=0.00..0.04 rows=2 width=607) (actual rows= loops=)

503.          

CTE smart_selection

504. 0.000 0.000 ↓ 0.0

Unique (cost=11.64..14.14 rows=200 width=121) (actual rows= loops=)

505. 0.000 0.000 ↓ 0.0

Sort (cost=11.64..12.14 rows=200 width=121) (actual rows= loops=)

  • 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])
506. 0.000 0.000 ↓ 0.0

CTE Scan on smart_selection_unnest (cost=0.00..4.00 rows=200 width=121) (actual rows= loops=)

507.          

CTE menu_component_selected_compact

508. 0.000 0.000 ↓ 0.0

Hash Join (cost=0.07..4.90 rows=2 width=379) (actual rows= loops=)

  • Hash Cond: (smart_selection."rowNumberMenuComponent" = menu_component_15."rowNumberMenuComponent")
509. 0.000 0.000 ↓ 0.0

CTE Scan on smart_selection (cost=0.00..4.00 rows=200 width=101) (actual rows= loops=)

510. 0.000 0.000 ↓ 0.0

Hash (cost=0.04..0.04 rows=2 width=252) (actual rows= loops=)

511. 0.000 0.000 ↓ 0.0

CTE Scan on menu_component menu_component_15 (cost=0.00..0.04 rows=2 width=252) (actual rows= loops=)

512.          

CTE menu_component_selected

513. 0.000 0.000 ↓ 0.0

Hash Join (cost=0.07..4.83 rows=2 width=861) (actual rows= loops=)

  • Hash Cond: (smart_selection_unnest_1.index = menu_component_selected_compact.index)
514. 0.000 0.000 ↓ 0.0

CTE Scan on smart_selection_unnest smart_selection_unnest_1 (cost=0.00..4.00 rows=200 width=583) (actual rows= loops=)

515. 0.000 0.000 ↓ 0.0

Hash (cost=0.04..0.04 rows=2 width=282) (actual rows= loops=)

516. 0.000 0.000 ↓ 0.0

CTE Scan on menu_component_selected_compact (cost=0.00..0.04 rows=2 width=282) (actual rows= loops=)

517.          

CTE get_nutritions

518. 0.000 0.000 ↓ 0.0

Unique (cost=2.26..2.27 rows=1 width=326) (actual rows= loops=)

519. 0.000 0.000 ↓ 0.0

Sort (cost=2.26..2.27 rows=1 width=326) (actual rows= loops=)

  • Sort Key: menu_with_production_time_lag_4."idRecipeMenu", "Nutrition_Recipe"."idNutrition
520. 0.000 0.000 ↓ 0.0

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

521. 0.000 0.000 ↓ 0.0

Hash Join (cost=0.03..1.88 rows=1 width=8) (actual rows= loops=)

  • Hash Cond: ("Nutrition_Recipe"."idRecipe" = menu_with_production_time_lag_4."idRecipeMenu")
522. 0.000 0.000 ↓ 0.0

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

523. 0.000 0.000 ↓ 0.0

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

524. 0.000 0.000 ↓ 0.0

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

525. 0.000 0.000 ↓ 0.0

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

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

CTE get_nutritions_array

527. 0.000 0.000 ↓ 0.0

Unique (cost=0.03..0.06 rows=1 width=68) (actual rows= loops=)

528. 0.000 0.000 ↓ 0.0

WindowAgg (cost=0.03..0.05 rows=1 width=68) (actual rows= loops=)

529. 0.000 0.000 ↓ 0.0

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

  • Sort Key: get_nutritions."idRecipeMenu
530. 0.000 0.000 ↓ 0.0

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

531.          

CTE get_products_allergens

532. 0.000 0.000 ↓ 0.0

Result (cost=0.00..4.05 rows=200 width=80) (actual rows= loops=)

533. 0.000 0.000 ↓ 0.0

ProjectSet (cost=0.00..1.05 rows=200 width=78) (actual rows= loops=)

534. 0.000 0.000 ↓ 0.0

CTE Scan on menu_component_selected (cost=0.00..0.04 rows=2 width=108) (actual rows= loops=)

535.          

CTE get_products_info_array

536. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=11.64..30.14 rows=200 width=108) (actual rows= loops=)

  • 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.000 0.000 ↓ 0.0

Sort (cost=11.64..12.14 rows=200 width=80) (actual rows= loops=)

  • 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
538. 0.000 0.000 ↓ 0.0

CTE Scan on get_products_allergens (cost=0.00..4.00 rows=200 width=80) (actual rows= loops=)

539.          

CTE recipes

540. 0.000 0.000 ↓ 0.0

HashAggregate (cost=0.11..0.14 rows=2 width=110) (actual rows= loops=)

  • 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.000 0.000 ↓ 0.0

CTE Scan on menu_component_selected menu_component_selected_1 (cost=0.00..0.04 rows=2 width=122) (actual rows= loops=)

542.          

CTE menu_with_recipes_detailed

543. 0.000 0.000 ↓ 0.0

Unique (cost=7.36..7.54 rows=2 width=685) (actual rows= loops=)

544. 0.000 0.000 ↓ 0.0

Sort (cost=7.36..7.36 rows=2 width=685) (actual rows= loops=)

  • 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)
545. 0.000 0.000 ↓ 0.0

Append (cost=0.04..7.35 rows=2 width=685) (actual rows= loops=)

546. 0.000 0.000 ↓ 0.0

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

  • Join Filter: (menu_with_production_time_lag_5."idRecipeMenu" = get_nutritions_array."idRecipeMenu")
547. 0.000 0.000 ↓ 0.0

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

  • 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"))
548. 0.000 0.000 ↓ 0.0

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

  • 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. 0.000 0.000 ↓ 0.0

CTE Scan on get_products_info_array (cost=0.00..4.00 rows=200 width=108) (actual rows= loops=)

550. 0.000 0.000 ↓ 0.0

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

551. 0.000 0.000 ↓ 0.0

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

552. 0.000 0.000 ↓ 0.0

CTE Scan on recipes (cost=0.00..0.04 rows=2 width=110) (actual rows= loops=)

553. 0.000 0.000 ↓ 0.0

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

554. 0.000 0.000 ↓ 0.0

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

555. 0.000 0.000 ↓ 0.0

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

  • Filter: ("idElementRecipe" = 1)
556.          

CTE menu_components_for_nut_composition

557. 0.000 0.000 ↓ 0.0

CTE Scan on menu_component_selected menu_component_selected_2 (cost=0.00..0.04 rows=2 width=90) (actual rows= loops=)

558.          

CTE menu_component_selected_with_weight

559. 0.000 0.000 ↓ 0.0

Unique (cost=33.95..33.99 rows=2 width=224) (actual rows= loops=)

560. 0.000 0.000 ↓ 0.0

Sort (cost=33.95..33.95 rows=2 width=224) (actual rows= loops=)

  • 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
561. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.70..33.94 rows=2 width=224) (actual rows= loops=)

562. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.55..17.36 rows=2 width=138) (actual rows= loops=)

563. 0.000 0.000 ↓ 0.0

CTE Scan on menu_components_for_nut_composition (cost=0.00..0.04 rows=2 width=90) (actual rows= loops=)

564. 0.000 0.000 ↓ 0.0

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

565. 0.000 0.000 ↓ 0.0

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

  • Index Cond: (id = menu_components_for_nut_composition."idGeneric")
566. 0.000 0.000 ↓ 0.0

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

  • Index Cond: ("idElement" = generic.id)
567. 0.000 0.000 ↓ 0.0

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

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

CTE menu_recipe_nut_composition_compute

569. 0.000 0.000 ↓ 0.0

Unique (cost=0.25..0.26 rows=2 width=112) (actual rows= loops=)

570. 0.000 0.000 ↓ 0.0

Sort (cost=0.25..0.25 rows=2 width=112) (actual rows= loops=)

  • Sort Key: menu_component_selected_with_weight."idRecipeMenu", menu_component_selected_with_weight."dateStableConsumption
571. 0.000 0.000 ↓ 0.0

WindowAgg (cost=0.05..0.24 rows=2 width=112) (actual rows= loops=)

572. 0.000 0.000 ↓ 0.0

Sort (cost=0.05..0.06 rows=2 width=184) (actual rows= loops=)

  • 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
573. 0.000 0.000 ↓ 0.0

CTE Scan on menu_component_selected_with_weight (cost=0.00..0.04 rows=2 width=184) (actual rows= loops=)

574.          

CTE menu_recipes_nut_composition

575. 0.000 0.000 ↓ 0.0

Unique (cost=0.05..0.34 rows=2 width=68) (actual rows= loops=)

576. 0.000 0.000 ↓ 0.0

WindowAgg (cost=0.05..0.33 rows=2 width=68) (actual rows= loops=)

577. 0.000 0.000 ↓ 0.0

Sort (cost=0.05..0.06 rows=2 width=108) (actual rows= loops=)

  • Sort Key: menu_recipe_nut_composition_compute."idRecipeMenu", menu_recipe_nut_composition_compute."dateStableConsumption
578. 0.000 0.000 ↓ 0.0

CTE Scan on menu_recipe_nut_composition_compute (cost=0.00..0.04 rows=2 width=108) (actual rows= loops=)

579.          

CTE allergen_details

580. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..1.75 rows=1 width=186) (actual rows= loops=)

  • Join Filter: (ARRAY[("Allergen".id)::integer] <@ menu_with_recipes_detailed."idAllergens")
581. 0.000 0.000 ↓ 0.0

CTE Scan on menu_with_recipes_detailed (cost=0.00..0.04 rows=2 width=40) (actual rows= loops=)

582. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..1.22 rows=15 width=178) (actual rows= loops=)

583. 0.000 0.000 ↓ 0.0

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

584.          

CTE allergen_labels

585. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=0.03..0.06 rows=1 width=40) (actual rows= loops=)

  • Group Key: allergen_details."idMenuElement
586. 0.000 0.000 ↓ 0.0

Sort (cost=0.03..0.04 rows=1 width=126) (actual rows= loops=)

  • Sort Key: allergen_details."idMenuElement
587. 0.000 0.000 ↓ 0.0

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

588.          

CTE allergen_info

589. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..0.05 rows=1 width=218) (actual rows= loops=)

  • Join Filter: (allergen_details_1."idMenuElement" = allergen_labels_1."idMenuElement")
590. 0.000 0.000 ↓ 0.0

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

591. 0.000 0.000 ↓ 0.0

CTE Scan on allergen_labels allergen_labels_1 (cost=0.00..0.02 rows=1 width=40) (actual rows= loops=)

592.          

CTE menu_computed

593. 0.000 0.000 ↓ 0.0

WindowAgg (cost=52.34..53.06 rows=2 width=2,297) (actual rows= loops=)

594. 0.000 0.000 ↓ 0.0

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

  • Sort Key: menu_with_recipes_detailed_1.id
595. 0.000 0.000 ↓ 0.0

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

596. 0.000 0.000 ↓ 0.0

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

  • 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.000 0.000 ↓ 0.0

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

598. 0.000 0.000 ↓ 0.0

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

599. 0.000 0.000 ↓ 0.0

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

  • 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"))
600. 0.000 0.000 ↓ 0.0

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

  • Join Filter: (menu_with_recipes_detailed_1."idProductionWorkshop" = "ProductionWorkshop".id)
601. 0.000 0.000 ↓ 0.0

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

  • Join Filter: ("RecipeFamily"."idRecipeFamilyParent" = familyparent.id)
602. 0.000 0.000 ↓ 0.0

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

603. 0.000 0.000 ↓ 0.0

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

  • Merge Cond: ((menu_with_recipes_detailed_1."idCategoryMenu" = categorymenuweek."idCategoryMenu") AND (menu_with_recipes_detailed_1."idMealType" = categorymenuweek."idMealType"))
604. 0.000 0.000 ↓ 0.0

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

  • Sort Key: menu_with_recipes_detailed_1."idCategoryMenu", menu_with_recipes_detailed_1."idMealType
605. 0.000 0.000 ↓ 0.0

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

  • 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.000 0.000 ↓ 0.0

Sort (cost=29.00..29.00 rows=2 width=1,234) (actual rows= loops=)

  • Sort Key: menu_with_recipes_detailed_1."idRecipeMenu
607. 0.000 0.000 ↓ 0.0

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

  • Join Filter: (site_prod_param."dateValid" @> menu_with_recipes_detailed_1."dateConsumption")
608. 0.000 0.000 ↓ 0.0

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

  • Join Filter: ("MealType".id = "MealType_Dish"."idMealType")
609. 0.000 0.000 ↓ 0.0

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

  • Join Filter: ("Dish"."idDishGroup" = "DishGroup".id)
610. 0.000 0.000 ↓ 0.0

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

611. 0.000 0.000 ↓ 0.0

Materialize (cost=3.12..26.24 rows=2 width=1,086) (actual rows= loops=)

612. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3.12..26.23 rows=2 width=1,086) (actual rows= loops=)

613. 0.000 0.000 ↓ 0.0

Hash Join (cost=2.84..9.62 rows=2 width=1,059) (actual rows= loops=)

  • Hash Cond: ("CategoryMenu_3".id = menu_with_recipes_detailed_1."idCategoryMenu")
614. 0.000 0.000 ↓ 0.0

Seq Scan on "CategoryMenu" "CategoryMenu_3" (cost=0.00..5.73 rows=273 width=20) (actual rows= loops=)

615. 0.000 0.000 ↓ 0.0

Hash (cost=2.82..2.82 rows=2 width=1,043) (actual rows= loops=)

616. 0.000 0.000 ↓ 0.0

Hash Join (cost=1.38..2.82 rows=2 width=1,043) (actual rows= loops=)

  • Hash Cond: ("Dish".id = menu_with_recipes_detailed_1."idDish")
617. 0.000 0.000 ↓ 0.0

Seq Scan on "Dish" (cost=0.00..1.30 rows=30 width=182) (actual rows= loops=)

618. 0.000 0.000 ↓ 0.0

Hash (cost=1.36..1.36 rows=2 width=861) (actual rows= loops=)

619. 0.000 0.000 ↓ 0.0

Hash Join (cost=0.07..1.36 rows=2 width=861) (actual rows= loops=)

  • Hash Cond: ("MealType".id = menu_with_recipes_detailed_1."idMealType")
620. 0.000 0.000 ↓ 0.0

Seq Scan on "MealType" (cost=0.00..1.20 rows=20 width=180) (actual rows= loops=)

621. 0.000 0.000 ↓ 0.0

Hash (cost=0.04..0.04 rows=2 width=681) (actual rows= loops=)

622. 0.000 0.000 ↓ 0.0

CTE Scan on menu_with_recipes_detailed menu_with_recipes_detailed_1 (cost=0.00..0.04 rows=2 width=681) (actual rows= loops=)

623. 0.000 0.000 ↓ 0.0

Index Scan using "Element_PK" on "Element" (cost=0.28..8.29 rows=1 width=31) (actual rows= loops=)

  • Index Cond: (id = menu_with_recipes_detailed_1."idElement")
624. 0.000 0.000 ↓ 0.0

Index Scan using "MealType_Dish_PK" on "MealType_Dish" (cost=0.14..0.70 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ("idDish" = "Dish".id)
625. 0.000 0.000 ↓ 0.0

CTE Scan on site_prod_param (cost=0.00..0.02 rows=1 width=64) (actual rows= loops=)

626. 0.000 0.000 ↓ 0.0

Sort (cost=0.05..0.06 rows=2 width=68) (actual rows= loops=)

  • Sort Key: menu_recipes_nut_composition."idRecipeMenu
627. 0.000 0.000 ↓ 0.0

CTE Scan on menu_recipes_nut_composition (cost=0.00..0.04 rows=2 width=68) (actual rows= loops=)

628. 0.000 0.000 ↓ 0.0

Sort (cost=0.20..0.21 rows=6 width=8) (actual rows= loops=)

  • Sort Key: categorymenuweek."idCategoryMenu", categorymenuweek."idMealType
629. 0.000 0.000 ↓ 0.0

CTE Scan on categorymenuweek (cost=0.00..0.12 rows=6 width=8) (actual rows= loops=)

630. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.28..8.37 rows=1 width=260) (actual rows= loops=)

631. 0.000 0.000 ↓ 0.0

Index Scan using "Recipe_PK" on "Recipe" "Recipe_4" (cost=0.15..8.17 rows=1 width=80) (actual rows= loops=)

  • Index Cond: (id = menu_with_recipes_detailed_1."idRecipeMenu")
632. 0.000 0.000 ↓ 0.0

Index Scan using "RecipeFamily_PK" on "RecipeFamily" (cost=0.14..0.20 rows=1 width=184) (actual rows= loops=)

  • Index Cond: ("Recipe_4"."idRecipeFamily" = id)
633. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..1.24 rows=16 width=122) (actual rows= loops=)

634. 0.000 0.000 ↓ 0.0

Seq Scan on "RecipeFamily" familyparent (cost=0.00..1.16 rows=16 width=122) (actual rows= loops=)

635. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..1.09 rows=6 width=122) (actual rows= loops=)

636. 0.000 0.000 ↓ 0.0

Seq Scan on "ProductionWorkshop" (cost=0.00..1.06 rows=6 width=122) (actual rows= loops=)

637. 0.000 0.000 ↓ 0.0

Sort (cost=0.05..0.06 rows=2 width=44) (actual rows= loops=)

  • Sort Key: menu_basisweight_1."idCategoryMenu", menu_basisweight_1."idMealType
638. 0.000 0.000 ↓ 0.0

CTE Scan on menu_basisweight menu_basisweight_1 (cost=0.00..0.04 rows=2 width=44) (actual rows= loops=)

639. 0.000 0.000 ↓ 0.0

Index Scan using "Tax_PK" on "Tax" (cost=0.14..0.29 rows=1 width=36) (actual rows= loops=)

  • Index Cond: ("RecipePrice"."idTax" = id)
640.          

CTE get_products_info

641. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.20..11.80 rows=1 width=112) (actual rows= loops=)

642. 0.000 0.000 ↓ 0.0

Hash Join (cost=0.07..11.42 rows=2 width=120) (actual rows= loops=)

  • Hash Cond: ("Generic_1"."idElement" = menu_component_selected_3."idGeneric")
643. 0.000 0.000 ↓ 0.0

Seq Scan on "Generic" "Generic_1" (cost=0.00..9.88 rows=388 width=8) (actual rows= loops=)

644. 0.000 0.000 ↓ 0.0

Hash (cost=0.04..0.04 rows=2 width=116) (actual rows= loops=)

645. 0.000 0.000 ↓ 0.0

CTE Scan on menu_component_selected menu_component_selected_3 (cost=0.00..0.04 rows=2 width=116) (actual rows= loops=)

646. 0.000 0.000 ↓ 0.0

Index Scan using "GenericFamily_PK" on "GenericFamily" (cost=0.13..0.18 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = "Generic_1"."idGenericFamily")
  • Filter: "isFood
647.          

CTE get_products_certifications

648. 0.000 0.000 ↓ 0.0

Result (cost=0.00..2.03 rows=100 width=80) (actual rows= loops=)

649. 0.000 0.000 ↓ 0.0

ProjectSet (cost=0.00..0.53 rows=100 width=78) (actual rows= loops=)

650. 0.000 0.000 ↓ 0.0

CTE Scan on get_products_info (cost=0.00..0.02 rows=1 width=108) (actual rows= loops=)

651.          

CTE get_products_ids_and_certifications_array

652. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=4.31..4.41 rows=1 width=140) (actual rows= loops=)

  • 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.000 0.000 ↓ 0.0

Sort (cost=4.31..4.32 rows=1 width=84) (actual rows= loops=)

  • 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
654. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=0.04..4.30 rows=1 width=84) (actual rows= loops=)

  • 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.000 0.000 ↓ 0.0

CTE Scan on get_products_certifications (cost=0.00..2.00 rows=100 width=80) (actual rows= loops=)

656. 0.000 0.000 ↓ 0.0

Hash (cost=0.02..0.02 rows=1 width=80) (actual rows= loops=)

657. 0.000 0.000 ↓ 0.0

CTE Scan on get_products_info get_products_info_1 (cost=0.00..0.02 rows=1 width=80) (actual rows= loops=)

658.          

CTE get_products_info_by_menu_element

659. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.00..0.07 rows=1 width=72) (actual rows= loops=)

  • 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"))
660. 0.000 0.000 ↓ 0.0

CTE Scan on menu_with_production_time_lag menu_with_production_time_lag_6 (cost=0.00..0.02 rows=1 width=28) (actual rows= loops=)

661. 0.000 0.000 ↓ 0.0

CTE Scan on get_products_ids_and_certifications_array (cost=0.00..0.02 rows=1 width=140) (actual rows= loops=)

662.          

CTE products_certifications_labels

663. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=1.21..1.24 rows=1 width=80) (actual rows= loops=)

  • Group Key: get_products_info_by_menu_element."idMenuElement", get_products_info_by_menu_element."idCertifications
664. 0.000 0.000 ↓ 0.0

Sort (cost=1.21..1.22 rows=1 width=158) (actual rows= loops=)

  • Sort Key: get_products_info_by_menu_element."idMenuElement", get_products_info_by_menu_element."idCertifications
665. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..1.20 rows=1 width=158) (actual rows= loops=)

  • Join Filter: (ARRAY["Certification".id] <@ get_products_info_by_menu_element."idCertifications")
666. 0.000 0.000 ↓ 0.0

CTE Scan on get_products_info_by_menu_element (cost=0.00..0.02 rows=1 width=40) (actual rows= loops=)

667. 0.000 0.000 ↓ 0.0

Seq Scan on "Certification" (cost=0.00..1.08 rows=8 width=122) (actual rows= loops=)

668.          

CTE products_unnest

669. 0.000 0.000 ↓ 0.0

ProjectSet (cost=0.00..0.53 rows=100 width=12) (actual rows= loops=)

670. 0.000 0.000 ↓ 0.0

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 rows= loops=)

671.          

CTE products_labels

672. 0.000 0.000 ↓ 0.0

Hash Join (cost=3.25..23.88 rows=64 width=30) (actual rows= loops=)

  • Hash Cond: ("Element_1".id = products_unnest."idProduct")
673. 0.000 0.000 ↓ 0.0

Seq Scan on "Element" "Element_1" (cost=0.00..18.54 rows=388 width=22) (actual rows= loops=)

  • Filter: (type = ANY ('{1,2}'::integer[]))
674. 0.000 0.000 ↓ 0.0

Hash (cost=2.00..2.00 rows=100 width=12) (actual rows= loops=)

675. 0.000 0.000 ↓ 0.0

CTE Scan on products_unnest (cost=0.00..2.00 rows=100 width=12) (actual rows= loops=)

676.          

CTE products_labels_array

677. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=1.57..1.60 rows=1 width=72) (actual rows= loops=)

  • Group Key: products_labels."idMenuElement", get_products_info_by_menu_element_2."idProducts
678. 0.000 0.000 ↓ 0.0

Sort (cost=1.57..1.58 rows=1 width=358) (actual rows= loops=)

  • Sort Key: products_labels."idMenuElement", get_products_info_by_menu_element_2."idProducts
679. 0.000 0.000 ↓ 0.0

Hash Join (cost=0.03..1.56 rows=1 width=358) (actual rows= loops=)

  • Hash Cond: (products_labels."idMenuElement" = get_products_info_by_menu_element_2."idMenuElement")
680. 0.000 0.000 ↓ 0.0

CTE Scan on products_labels (cost=0.00..1.28 rows=64 width=326) (actual rows= loops=)

681. 0.000 0.000 ↓ 0.0

Hash (cost=0.02..0.02 rows=1 width=40) (actual rows= loops=)

682. 0.000 0.000 ↓ 0.0

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 rows= loops=)

683.          

CTE recipe_tags

684. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.21..3.39 rows=2 width=17) (actual rows= loops=)

685. 0.000 0.000 ↓ 0.0

Hash Join (cost=0.07..2.89 rows=2 width=8) (actual rows= loops=)

  • Hash Cond: ("Recipe_Tag"."idRecipe" = menu_computed_1."idRecipeMenu")
686. 0.000 0.000 ↓ 0.0

Seq Scan on "Recipe_Tag" (cost=0.00..2.31 rows=131 width=8) (actual rows= loops=)

687. 0.000 0.000 ↓ 0.0

Hash (cost=0.04..0.04 rows=2 width=8) (actual rows= loops=)

688. 0.000 0.000 ↓ 0.0

CTE Scan on menu_computed menu_computed_1 (cost=0.00..0.04 rows=2 width=8) (actual rows= loops=)

689. 0.000 0.000 ↓ 0.0

Index Scan using "Tag_PK" on "Tag" (cost=0.14..0.25 rows=1 width=17) (actual rows= loops=)

  • Index Cond: (id = "Recipe_Tag"."idTag")
690.          

CTE recipe_tags_array

691. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=0.05..0.10 rows=2 width=36) (actual rows= loops=)

  • Group Key: recipe_tags."idRecipe
692. 0.000 0.000 ↓ 0.0

Sort (cost=0.05..0.06 rows=2 width=122) (actual rows= loops=)

  • Sort Key: recipe_tags."idRecipe
693. 0.000 0.000 ↓ 0.0

CTE Scan on recipe_tags (cost=0.00..0.04 rows=2 width=122) (actual rows= loops=)

694. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=0.20..0.33 rows=2 width=3,127) (actual rows= loops=)

  • Hash Cond: (menu_computed."idMenuElement" = allergen_info."idMenuElement")
695. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=0.16..0.28 rows=2 width=2,917) (actual rows= loops=)

  • Hash Cond: (menu_computed."idMenuElement" = allergen_labels."idMenuElement")
696. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=0.13..0.23 rows=2 width=2,917) (actual rows= loops=)

  • Hash Cond: (menu_computed."idElement" = recipe_tags_array."idRecipe")
697. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=0.07..0.14 rows=2 width=2,885) (actual rows= loops=)

  • Hash Cond: (menu_computed."idMenuElement" = products_labels_array."idMenuElement")
698. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=0.03..0.09 rows=2 width=2,821) (actual rows= loops=)

  • Hash Cond: (menu_computed."idMenuElement" = products_certifications_labels."idMenuElement")
699. 0.000 0.000 ↓ 0.0

CTE Scan on menu_computed (cost=0.00..0.04 rows=2 width=2,757) (actual rows= loops=)

700. 0.000 0.000 ↓ 0.0

Hash (cost=0.02..0.02 rows=1 width=72) (actual rows= loops=)

701. 0.000 0.000 ↓ 0.0

CTE Scan on products_certifications_labels (cost=0.00..0.02 rows=1 width=72) (actual rows= loops=)

702. 0.000 0.000 ↓ 0.0

Hash (cost=0.02..0.02 rows=1 width=72) (actual rows= loops=)

703. 0.000 0.000 ↓ 0.0

CTE Scan on products_labels_array (cost=0.00..0.02 rows=1 width=72) (actual rows= loops=)

704. 0.000 0.000 ↓ 0.0

Hash (cost=0.04..0.04 rows=2 width=36) (actual rows= loops=)

705. 0.000 0.000 ↓ 0.0

CTE Scan on recipe_tags_array (cost=0.00..0.04 rows=2 width=36) (actual rows= loops=)

706. 0.000 0.000 ↓ 0.0

Hash (cost=0.02..0.02 rows=1 width=8) (actual rows= loops=)

707. 0.000 0.000 ↓ 0.0

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

708. 0.000 0.000 ↓ 0.0

Hash (cost=0.02..0.02 rows=1 width=218) (actual rows= loops=)

709. 0.000 0.000 ↓ 0.0

CTE Scan on allergen_info (cost=0.00..0.02 rows=1 width=218) (actual rows= loops=)