explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6uNY

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

GroupAggregate (cost=11,669,337.24..11,669,349.58 rows=200 width=556) (actual rows= loops=)

  • Group Key: "*SELECT* 1"."productCategoryId", "*SELECT* 1"."productCategoryName", "*SELECT* 1".year, "*SELECT* 1".month
2. 0.000 0.000 ↓ 0.0

Sort (cost=11,669,337.24..11,669,338.72 rows=591 width=556) (actual rows= loops=)

  • Sort Key: "*SELECT* 1"."productCategoryId", "*SELECT* 1"."productCategoryName", "*SELECT* 1".month
3. 0.000 0.000 ↓ 0.0

Append (cost=5,814,678.19..11,669,310.03 rows=591 width=556) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1 (cost=5,814,678.19..5,819,173.44 rows=565 width=556) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,814,678.19..5,819,167.79 rows=565 width=6,696) (actual rows= loops=)

  • Hash Cond: (p."marketingFocusId" = mf.id)
6. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,814,665.04..5,819,141.81 rows=565 width=624) (actual rows= loops=)

  • Hash Cond: (p."marketingManagedId" = mm.id)
7. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,814,651.89..5,819,127.13 rows=565 width=640) (actual rows= loops=)

  • Hash Cond: (p."demographicId" = d.id)
8. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,814,638.74..5,819,112.46 rows=565 width=656) (actual rows= loops=)

  • Hash Cond: (p."formId" = f.id)
9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,814,625.59..5,819,097.78 rows=565 width=672) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Index Only Scan using producttype_name_unique on "ProductType" pt (cost=0.14..8.16 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (name = 'finishedGood'::text)
11. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,814,625.45..5,819,083.97 rows=565 width=676) (actual rows= loops=)

  • Hash Cond: (p."subBrandId" = sb.id)
12. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,814,608.71..5,819,059.46 rows=565 width=692) (actual rows= loops=)

  • Hash Cond: (mpv."marketId" = m.id)
13. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,814,587.52..5,819,030.50 rows=565 width=704) (actual rows= loops=)

  • Hash Cond: (mpv_1.id = mpv.id)
14. 0.000 0.000 ↓ 0.0

Group (cost=5,813,934.62..5,816,797.42 rows=114,512 width=96) (actual rows= loops=)

  • Group Key: (COALESCE(forecast.year, m_1.year)), (COALESCE(forecast.month, m_1.month)), mpv_1.id, forecast.units, m_1.units
15.          

Initplan (for Group)

16. 0.000 0.000 ↓ 0.0

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

17. 0.000 0.000 ↓ 0.0

Sort (cost=33.55..37.48 rows=1,570 width=24) (actual rows= loops=)

  • Sort Key: fi_2."importedAt" DESC
18. 0.000 0.000 ↓ 0.0

Seq Scan on "ForecastImport" fi_2 (cost=0.00..25.70 rows=1,570 width=24) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Sort (cost=5,813,901.07..5,814,187.35 rows=114,512 width=38) (actual rows= loops=)

  • Sort Key: (COALESCE(forecast.year, m_1.year)), (COALESCE(forecast.month, m_1.month)), mpv_1.id, forecast.units, m_1.units
20. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3,210.15..5,801,146.62 rows=114,512 width=38) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash Full Join (cost=3,194.44..4,669,995.51 rows=57,257 width=56) (actual rows= loops=)

  • Hash Cond: ((m_1."marketProductVariantId" = forecast."marketProductVariantId") AND (m_1.month = forecast.month) AND (m_1.year = forecast.year))
  • Filter: ((COALESCE(forecast.year, m_1.year) = 2,020) AND ((COALESCE(forecast.month, m_1.month) = 1) OR (COALESCE(forecast.month, m_1.month) = 2) OR (COALESCE(forecast.month, m_1.month) = 3) OR (COALESCE(forecast.month, m_1.month) = 4) OR (COALESCE(forecast.month, m_1.month) = 5) OR (COALESCE(forecast.month, m_1.month) = 6) OR (COALESCE(forecast.month, m_1.month) = 7) OR (COALESCE(forecast.month, m_1.month) = 8) OR (COALESCE(forecast.month, m_1.month) = 9) OR (COALESCE(forecast.month, m_1.month) = 10) OR (COALESCE(forecast.month, m_1.month) = 11) OR (COALESCE(forecast.month, m_1.month) = 12)))
22. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..2,455,037.42 rows=196,162,080 width=28) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Seq Scan on "MonthlyMarketProductVariantDemand" m_1 (cost=0.00..2,981.80 rows=124,944 width=28) (actual rows= loops=)

  • Filter: ("forecastImportId" = $0)
24. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..33.55 rows=1,570 width=0) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Seq Scan on "ForecastImport" fi (cost=0.00..25.70 rows=1,570 width=0) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Hash (cost=3,184.12..3,184.12 rows=590 width=28) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Hash Join (cost=41.75..3,184.12 rows=590 width=28) (actual rows= loops=)

  • Hash Cond: ((forecast."forecastImportId" = abf."forecastImportId") AND (forecast.year = abf.year))
28. 0.000 0.000 ↓ 0.0

Seq Scan on "MonthlyMarketProductVariantForecast" forecast (cost=0.00..2,522.57 rows=118,057 width=44) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Hash (cost=22.70..22.70 rows=1,270 width=20) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Seq Scan on "AnnualBudgetForecast" abf (cost=0.00..22.70 rows=1,270 width=20) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on "MarketProductVariant" mpv_1 (cost=15.71..19.74 rows=2 width=22) (actual rows= loops=)

  • Recheck Cond: ((forecast."marketProductVariantId" = id) OR (m_1."marketProductVariantId" = id))
32. 0.000 0.000 ↓ 0.0

BitmapOr (cost=15.71..15.71 rows=2 width=0) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on "MarketProductVariant_pkey" (cost=0.00..0.45 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (forecast."marketProductVariantId" = id)
34. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on "MarketProductVariant_pkey" (cost=0.00..0.45 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (m_1."marketProductVariantId" = id)
35. 0.000 0.000 ↓ 0.0

Hash (cost=651.08..651.08 rows=146 width=648) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Nested Loop (cost=341.49..651.08 rows=146 width=648) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

Hash Join (cost=341.08..541.05 rows=43 width=632) (actual rows= loops=)

  • Hash Cond: (pc."businessLineId" = bl.id)
38. 0.000 0.000 ↓ 0.0

Hash Join (cost=327.93..527.78 rows=43 width=648) (actual rows= loops=)

  • Hash Cond: (psc."productCategoryId" = pc.id)
39. 0.000 0.000 ↓ 0.0

Hash Join (cost=314.78..514.52 rows=43 width=116) (actual rows= loops=)

  • Hash Cond: (ic."productSubcategoryId" = psc.id)
40. 0.000 0.000 ↓ 0.0

Hash Join (cost=311.53..511.16 rows=43 width=116) (actual rows= loops=)

  • Hash Cond: (p."industryCutId" = ic.id)
41. 0.000 0.000 ↓ 0.0

Hash Join (cost=303.42..502.94 rows=43 width=116) (actual rows= loops=)

  • Hash Cond: (pv."productId" = p.id)
42. 0.000 0.000 ↓ 0.0

Seq Scan on "ProductVariant" pv (cost=0.00..176.73 rows=8,673 width=32) (actual rows= loops=)

43. 0.000 0.000 ↓ 0.0

Hash (cost=303.12..303.12 rows=24 width=132) (actual rows= loops=)

44. 0.000 0.000 ↓ 0.0

Seq Scan on "Product" p (cost=0.00..303.12 rows=24 width=132) (actual rows= loops=)

  • Filter: ((type)::text = 'finishedGood'::text)
45. 0.000 0.000 ↓ 0.0

Hash (cost=5.27..5.27 rows=227 width=32) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Seq Scan on "IndustryCut" ic (cost=0.00..5.27 rows=227 width=32) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

Hash (cost=2.00..2.00 rows=100 width=32) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Seq Scan on "ProductSubcategory" psc (cost=0.00..2.00 rows=100 width=32) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Hash (cost=11.40..11.40 rows=140 width=548) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

Seq Scan on "ProductCategory" pc (cost=0.00..11.40 rows=140 width=548) (actual rows= loops=)

51. 0.000 0.000 ↓ 0.0

Hash (cost=11.40..11.40 rows=140 width=16) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

Seq Scan on "BusinessLine" bl (cost=0.00..11.40 rows=140 width=16) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

Index Scan using marketproductvariant_productvariantid_marketid_unique on "MarketProductVariant" mpv (cost=0.41..2.53 rows=3 width=48) (actual rows= loops=)

  • Index Cond: ("productVariantId" = pv.id)
54. 0.000 0.000 ↓ 0.0

Hash (cost=20.45..20.45 rows=59 width=20) (actual rows= loops=)

55. 0.000 0.000 ↓ 0.0

Hash Join (cost=16.39..20.45 rows=59 width=20) (actual rows= loops=)

  • Hash Cond: (m."currencyId" = c.id)
56. 0.000 0.000 ↓ 0.0

Hash Join (cost=14.26..18.16 rows=59 width=32) (actual rows= loops=)

  • Hash Cond: (sr."regionId" = r.id)
57. 0.000 0.000 ↓ 0.0

Hash Join (cost=13.15..16.89 rows=59 width=48) (actual rows= loops=)

  • Hash Cond: (m."subregionId" = sr.id)
58. 0.000 0.000 ↓ 0.0

Seq Scan on "Market" m (cost=0.00..3.59 rows=59 width=48) (actual rows= loops=)

59. 0.000 0.000 ↓ 0.0

Hash (cost=11.40..11.40 rows=140 width=32) (actual rows= loops=)

60. 0.000 0.000 ↓ 0.0

Seq Scan on "Subregion" sr (cost=0.00..11.40 rows=140 width=32) (actual rows= loops=)

61. 0.000 0.000 ↓ 0.0

Hash (cost=1.05..1.05 rows=5 width=16) (actual rows= loops=)

62. 0.000 0.000 ↓ 0.0

Seq Scan on "Region" r (cost=0.00..1.05 rows=5 width=16) (actual rows= loops=)

63. 0.000 0.000 ↓ 0.0

Hash (cost=1.50..1.50 rows=50 width=20) (actual rows= loops=)

64. 0.000 0.000 ↓ 0.0

Seq Scan on "Currency" c (cost=0.00..1.50 rows=50 width=20) (actual rows= loops=)

65. 0.000 0.000 ↓ 0.0

Hash (cost=15.95..15.95 rows=63 width=16) (actual rows= loops=)

66. 0.000 0.000 ↓ 0.0

Hash Join (cost=13.15..15.95 rows=63 width=16) (actual rows= loops=)

  • Hash Cond: (sb."brandId" = b.id)
67. 0.000 0.000 ↓ 0.0

Seq Scan on "SubBrand" sb (cost=0.00..2.63 rows=63 width=32) (actual rows= loops=)

68. 0.000 0.000 ↓ 0.0

Hash (cost=11.40..11.40 rows=140 width=16) (actual rows= loops=)

69. 0.000 0.000 ↓ 0.0

Seq Scan on "Brand" b (cost=0.00..11.40 rows=140 width=16) (actual rows= loops=)

70. 0.000 0.000 ↓ 0.0

Hash (cost=11.40..11.40 rows=140 width=16) (actual rows= loops=)

71. 0.000 0.000 ↓ 0.0

Seq Scan on "Form" f (cost=0.00..11.40 rows=140 width=16) (actual rows= loops=)

72. 0.000 0.000 ↓ 0.0

Hash (cost=11.40..11.40 rows=140 width=16) (actual rows= loops=)

73. 0.000 0.000 ↓ 0.0

Seq Scan on "Demographic" d (cost=0.00..11.40 rows=140 width=16) (actual rows= loops=)

74. 0.000 0.000 ↓ 0.0

Hash (cost=11.40..11.40 rows=140 width=16) (actual rows= loops=)

75. 0.000 0.000 ↓ 0.0

Seq Scan on "MarketingManaged" mm (cost=0.00..11.40 rows=140 width=16) (actual rows= loops=)

76. 0.000 0.000 ↓ 0.0

Hash (cost=11.40..11.40 rows=140 width=16) (actual rows= loops=)

77. 0.000 0.000 ↓ 0.0

Seq Scan on "MarketingFocus" mf (cost=0.00..11.40 rows=140 width=16) (actual rows= loops=)

78. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=5,829,465.86..5,850,136.60 rows=26 width=556) (actual rows= loops=)

79. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,829,465.86..5,850,136.34 rows=26 width=6,696) (actual rows= loops=)

  • Hash Cond: (m_2."currencyId" = c_1.id)
80. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,463.74..5,850,133.22 rows=26 width=591) (actual rows= loops=)

81. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,463.59..5,850,128.74 rows=26 width=607) (actual rows= loops=)

82. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,463.45..5,850,124.26 rows=26 width=623) (actual rows= loops=)

83. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,463.30..5,850,119.78 rows=26 width=639) (actual rows= loops=)

84. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,463.16..5,850,115.29 rows=26 width=655) (actual rows= loops=)

85. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,463.01..5,850,091.25 rows=26 width=671) (actual rows= loops=)

86. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,462.87..5,850,087.07 rows=26 width=671) (actual rows= loops=)

  • Join Filter: (sr_1."regionId" = r_1.id)
87. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,462.87..5,850,084.06 rows=26 width=687) (actual rows= loops=)

88. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,462.73..5,850,058.30 rows=26 width=687) (actual rows= loops=)

89. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,462.58..5,850,051.21 rows=40 width=691) (actual rows= loops=)

90. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,462.43..5,850,030.99 rows=40 width=707) (actual rows= loops=)

91. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,462.29..5,850,005.28 rows=40 width=175) (actual rows= loops=)

92. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,462.15..5,849,996.76 rows=40 width=175) (actual rows= loops=)

93. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,462.00..5,849,990.10 rows=40 width=175) (actual rows= loops=)

94. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,461.72..5,849,973.36 rows=40 width=91) (actual rows= loops=)

95. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,461.43..5,849,960.53 rows=40 width=91) (actual rows= loops=)

96. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,461.29..5,849,954.06 rows=41 width=91) (actual rows= loops=)

97. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,460.88..5,849,749.75 rows=41 width=75) (actual rows= loops=)

98. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,460.74..5,849,661.06 rows=41 width=91) (actual rows= loops=)

99. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,460.59..5,849,572.37 rows=41 width=107) (actual rows= loops=)

100. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,460.45..5,849,483.68 rows=41 width=123) (actual rows= loops=)

101. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,460.30..5,849,394.99 rows=41 width=139) (actual rows= loops=)

  • Join Filter: (rf."marketProductVariantId" = mpvsbe."parentMarketProductVariantId")
102. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,460.30..5,831,095.84 rows=565 width=144) (actual rows= loops=)

103. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,460.16..5,831,080.61 rows=565 width=148) (actual rows= loops=)

  • Join Filter: (sb_2.id = p_2."subBrandId")
104. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,829,447.01..5,830,530.58 rows=565 width=164) (actual rows= loops=)

  • Join Filter: (m_2.id = mpv_3."marketId")
105. 0.000 0.000 ↓ 0.0

Merge Join (cost=22.81..23.93 rows=59 width=48) (actual rows= loops=)

  • Merge Cond: (m_2."currencyId" = c_2.id)
106. 0.000 0.000 ↓ 0.0

Sort (cost=19.90..20.05 rows=59 width=32) (actual rows= loops=)

  • Sort Key: m_2."currencyId
107. 0.000 0.000 ↓ 0.0

Hash Join (cost=14.26..18.16 rows=59 width=32) (actual rows= loops=)

  • Hash Cond: (sr_2."regionId" = r_2.id)
108. 0.000 0.000 ↓ 0.0

Hash Join (cost=13.15..16.89 rows=59 width=48) (actual rows= loops=)

  • Hash Cond: (m_2."subregionId" = sr_2.id)
109. 0.000 0.000 ↓ 0.0

Seq Scan on "Market" m_2 (cost=0.00..3.59 rows=59 width=48) (actual rows= loops=)

110. 0.000 0.000 ↓ 0.0

Hash (cost=11.40..11.40 rows=140 width=32) (actual rows= loops=)

111. 0.000 0.000 ↓ 0.0

Seq Scan on "Subregion" sr_2 (cost=0.00..11.40 rows=140 width=32) (actual rows= loops=)

112. 0.000 0.000 ↓ 0.0

Hash (cost=1.05..1.05 rows=5 width=16) (actual rows= loops=)

113. 0.000 0.000 ↓ 0.0

Seq Scan on "Region" r_2 (cost=0.00..1.05 rows=5 width=16) (actual rows= loops=)

114. 0.000 0.000 ↓ 0.0

Sort (cost=2.91..3.04 rows=50 width=16) (actual rows= loops=)

  • Sort Key: c_2.id
115. 0.000 0.000 ↓ 0.0

Seq Scan on "Currency" c_2 (cost=0.00..1.50 rows=50 width=16) (actual rows= loops=)

116. 0.000 0.000 ↓ 0.0

Materialize (cost=5,829,424.20..5,830,008.04 rows=565 width=148) (actual rows= loops=)

117. 0.000 0.000 ↓ 0.0

Merge Join (cost=5,829,424.20..5,830,005.22 rows=565 width=148) (actual rows= loops=)

  • Merge Cond: (rf."marketProductVariantId" = mpv_3.id)
118. 0.000 0.000 ↓ 0.0

Sort (cost=5,828,767.87..5,829,054.15 rows=114,512 width=32) (actual rows= loops=)

  • Sort Key: rf."marketProductVariantId
119. 0.000 0.000 ↓ 0.0

Subquery Scan on rf (cost=5,813,542.62..5,816,405.42 rows=114,512 width=32) (actual rows= loops=)

120. 0.000 0.000 ↓ 0.0

Group (cost=5,813,542.62..5,815,260.30 rows=114,512 width=96) (actual rows= loops=)

  • Group Key: (COALESCE(forecast_1.year, m_3.year)), (COALESCE(forecast_1.month, m_3.month)), mpv_4.id, forecast_1.units, m_3.units
121.          

Initplan (for Group)

122. 0.000 0.000 ↓ 0.0

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

123. 0.000 0.000 ↓ 0.0

Sort (cost=33.55..37.48 rows=1,570 width=24) (actual rows= loops=)

  • Sort Key: fi_3."importedAt" DESC
124. 0.000 0.000 ↓ 0.0

Seq Scan on "ForecastImport" fi_3 (cost=0.00..25.70 rows=1,570 width=24) (actual rows= loops=)

125. 0.000 0.000 ↓ 0.0

Sort (cost=5,813,509.07..5,813,795.35 rows=114,512 width=32) (actual rows= loops=)

  • Sort Key: (COALESCE(forecast_1.year, m_3.year)), (COALESCE(forecast_1.month, m_3.month)), mpv_4.id, forecast_1.units, m_3.units
126. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3,210.15..5,801,146.62 rows=114,512 width=32) (actual rows= loops=)

127. 0.000 0.000 ↓ 0.0

Hash Full Join (cost=3,194.44..4,669,995.51 rows=57,257 width=56) (actual rows= loops=)

  • Hash Cond: ((m_3."marketProductVariantId" = forecast_1."marketProductVariantId") AND (m_3.month = forecast_1.month) AND (m_3.year = forecast_1.year))
  • Filter: ((COALESCE(forecast_1.year, m_3.year) = 2,020) AND ((COALESCE(forecast_1.month, m_3.month) = 1) OR (COALESCE(forecast_1.month, m_3.month) = 2) OR (COALESCE(forecast_1.month, m_3.month) = 3) OR (COALESCE(forecast_1.month, m_3.month) = 4) OR (COALESCE(forecast_1.month, m_3.month) = 5) OR (COALESCE(forecast_1.month, m_3.month) = 6) OR (COALESCE(forecast_1.month, m_3.month) = 7) OR (COALESCE(forecast_1.month, m_3.month) = 8) OR (COALESCE(forecast_1.month, m_3.month) = 9) OR (COALESCE(forecast_1.month, m_3.month) = 10) OR (COALESCE(forecast_1.month, m_3.month) = 11) OR (COALESCE(forecast_1.month, m_3.month) = 12)))
128. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..2,455,037.42 rows=196,162,080 width=28) (actual rows= loops=)

129. 0.000 0.000 ↓ 0.0

Seq Scan on "MonthlyMarketProductVariantDemand" m_3 (cost=0.00..2,981.80 rows=124,944 width=28) (actual rows= loops=)

  • Filter: ("forecastImportId" = $1)
130. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..33.55 rows=1,570 width=0) (actual rows= loops=)

131. 0.000 0.000 ↓ 0.0

Seq Scan on "ForecastImport" fi_1 (cost=0.00..25.70 rows=1,570 width=0) (actual rows= loops=)

132. 0.000 0.000 ↓ 0.0

Hash (cost=3,184.12..3,184.12 rows=590 width=28) (actual rows= loops=)

133. 0.000 0.000 ↓ 0.0

Hash Join (cost=41.75..3,184.12 rows=590 width=28) (actual rows= loops=)

  • Hash Cond: ((forecast_1."forecastImportId" = abf_1."forecastImportId") AND (forecast_1.year = abf_1.year))
134. 0.000 0.000 ↓ 0.0

Seq Scan on "MonthlyMarketProductVariantForecast" forecast_1 (cost=0.00..2,522.57 rows=118,057 width=44) (actual rows= loops=)

135. 0.000 0.000 ↓ 0.0

Hash (cost=22.70..22.70 rows=1,270 width=20) (actual rows= loops=)

136. 0.000 0.000 ↓ 0.0

Seq Scan on "AnnualBudgetForecast" abf_1 (cost=0.00..22.70 rows=1,270 width=20) (actual rows= loops=)

137. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on "MarketProductVariant" mpv_4 (cost=15.71..19.74 rows=2 width=16) (actual rows= loops=)

  • Recheck Cond: ((forecast_1."marketProductVariantId" = id) OR (m_3."marketProductVariantId" = id))
138. 0.000 0.000 ↓ 0.0

BitmapOr (cost=15.71..15.71 rows=2 width=0) (actual rows= loops=)

139. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on "MarketProductVariant_pkey" (cost=0.00..0.45 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (forecast_1."marketProductVariantId" = id)
140. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on "MarketProductVariant_pkey" (cost=0.00..0.45 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (m_3."marketProductVariantId" = id)
141. 0.000 0.000 ↓ 0.0

Sort (cost=656.33..656.69 rows=146 width=116) (actual rows= loops=)

  • Sort Key: mpv_3.id
142. 0.000 0.000 ↓ 0.0

Nested Loop (cost=341.49..651.08 rows=146 width=116) (actual rows= loops=)

143. 0.000 0.000 ↓ 0.0

Hash Join (cost=341.08..541.05 rows=43 width=100) (actual rows= loops=)

  • Hash Cond: (pc_2."businessLineId" = bl_2.id)
144. 0.000 0.000 ↓ 0.0

Hash Join (cost=327.93..527.78 rows=43 width=116) (actual rows= loops=)

  • Hash Cond: (psc_2."productCategoryId" = pc_2.id)
145. 0.000 0.000 ↓ 0.0

Hash Join (cost=314.78..514.52 rows=43 width=116) (actual rows= loops=)

  • Hash Cond: (ic_2."productSubcategoryId" = psc_2.id)
146. 0.000 0.000 ↓ 0.0

Hash Join (cost=311.53..511.16 rows=43 width=116) (actual rows= loops=)

  • Hash Cond: (p_2."industryCutId" = ic_2.id)
147. 0.000 0.000 ↓ 0.0

Hash Join (cost=303.42..502.94 rows=43 width=116) (actual rows= loops=)

  • Hash Cond: (pv_2."productId" = p_2.id)
148. 0.000 0.000 ↓ 0.0

Seq Scan on "ProductVariant" pv_2 (cost=0.00..176.73 rows=8,673 width=32) (actual rows= loops=)

149. 0.000 0.000 ↓ 0.0

Hash (cost=303.12..303.12 rows=24 width=132) (actual rows= loops=)

150. 0.000 0.000 ↓ 0.0

Seq Scan on "Product" p_2 (cost=0.00..303.12 rows=24 width=132) (actual rows= loops=)

  • Filter: ((type)::text = 'salesBundle'::text)
151. 0.000 0.000 ↓ 0.0

Hash (cost=5.27..5.27 rows=227 width=32) (actual rows= loops=)

152. 0.000 0.000 ↓ 0.0

Seq Scan on "IndustryCut" ic_2 (cost=0.00..5.27 rows=227 width=32) (actual rows= loops=)

153. 0.000 0.000 ↓ 0.0

Hash (cost=2.00..2.00 rows=100 width=32) (actual rows= loops=)

154. 0.000 0.000 ↓ 0.0

Seq Scan on "ProductSubcategory" psc_2 (cost=0.00..2.00 rows=100 width=32) (actual rows= loops=)

155. 0.000 0.000 ↓ 0.0

Hash (cost=11.40..11.40 rows=140 width=32) (actual rows= loops=)

156. 0.000 0.000 ↓ 0.0

Seq Scan on "ProductCategory" pc_2 (cost=0.00..11.40 rows=140 width=32) (actual rows= loops=)

157. 0.000 0.000 ↓ 0.0

Hash (cost=11.40..11.40 rows=140 width=16) (actual rows= loops=)

158. 0.000 0.000 ↓ 0.0

Seq Scan on "BusinessLine" bl_2 (cost=0.00..11.40 rows=140 width=16) (actual rows= loops=)

159. 0.000 0.000 ↓ 0.0

Index Scan using marketproductvariant_productvariantid_marketid_unique on "MarketProductVariant" mpv_3 (cost=0.41..2.53 rows=3 width=48) (actual rows= loops=)

  • Index Cond: ("productVariantId" = pv_2.id)
160. 0.000 0.000 ↓ 0.0

Materialize (cost=13.15..16.26 rows=63 width=16) (actual rows= loops=)

161. 0.000 0.000 ↓ 0.0

Hash Join (cost=13.15..15.95 rows=63 width=16) (actual rows= loops=)

  • Hash Cond: (sb_2."brandId" = b_2.id)
162. 0.000 0.000 ↓ 0.0

Seq Scan on "SubBrand" sb_2 (cost=0.00..2.63 rows=63 width=32) (actual rows= loops=)

163. 0.000 0.000 ↓ 0.0

Hash (cost=11.40..11.40 rows=140 width=16) (actual rows= loops=)

164. 0.000 0.000 ↓ 0.0

Seq Scan on "Brand" b_2 (cost=0.00..11.40 rows=140 width=16) (actual rows= loops=)

165. 0.000 0.000 ↓ 0.0

Materialize (cost=0.14..8.17 rows=1 width=32) (actual rows= loops=)

166. 0.000 0.000 ↓ 0.0

Index Only Scan using producttype_name_unique on "ProductType" pt_2 (cost=0.14..8.16 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (name = 'salesBundle'::text)
167. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..100.22 rows=2,148 width=43) (actual rows= loops=)

168. 0.000 0.000 ↓ 0.0

Seq Scan on "MarketProductVariantSalesBundleEntry" mpvsbe (cost=0.00..89.48 rows=2,148 width=43) (actual rows= loops=)

169. 0.000 0.000 ↓ 0.0

Index Only Scan using "Form_pkey" on "Form" f_2 (cost=0.14..2.16 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = p_2."formId")
170. 0.000 0.000 ↓ 0.0

Index Only Scan using "Demographic_pkey" on "Demographic" d_2 (cost=0.14..2.16 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = p_2."demographicId")
171. 0.000 0.000 ↓ 0.0

Index Only Scan using "MarketingManaged_pkey" on "MarketingManaged" mm_2 (cost=0.14..2.16 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = p_2."marketingManagedId")
172. 0.000 0.000 ↓ 0.0

Index Only Scan using "MarketingFocus_pkey" on "MarketingFocus" mf_2 (cost=0.14..2.16 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = p_2."marketingFocusId")
173. 0.000 0.000 ↓ 0.0

Index Scan using "MarketProductVariant_pkey" on "MarketProductVariant" mpv_2 (cost=0.41..4.98 rows=1 width=48) (actual rows= loops=)

  • Index Cond: (id = mpvsbe."marketProductVariantId")
174. 0.000 0.000 ↓ 0.0

Index Scan using "Market_pkey" on "Market" (cost=0.14..0.16 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (id = mpv_2."marketId")
  • Filter: (NOT "isHidden")
175. 0.000 0.000 ↓ 0.0

Index Scan using "ProductVariant_pkey" on "ProductVariant" pv_1 (cost=0.29..0.32 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (id = mpv_2."productVariantId")
176. 0.000 0.000 ↓ 0.0

Index Scan using "Product_pkey" on "Product" p_1 (cost=0.28..0.42 rows=1 width=132) (actual rows= loops=)

  • Index Cond: (id = pv_1."productId")
177. 0.000 0.000 ↓ 0.0

Index Scan using "IndustryCut_pkey" on "IndustryCut" ic_1 (cost=0.14..0.17 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (id = p_1."industryCutId")
178. 0.000 0.000 ↓ 0.0

Index Scan using "ProductSubcategory_pkey" on "ProductSubcategory" psc_1 (cost=0.14..0.21 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (id = ic_1."productSubcategoryId")
179. 0.000 0.000 ↓ 0.0

Index Scan using "ProductCategory_pkey" on "ProductCategory" pc_1 (cost=0.14..0.64 rows=1 width=548) (actual rows= loops=)

  • Index Cond: (id = psc_1."productCategoryId")
180. 0.000 0.000 ↓ 0.0

Index Only Scan using "BusinessLine_pkey" on "BusinessLine" bl_1 (cost=0.14..0.51 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = pc_1."businessLineId")
181. 0.000 0.000 ↓ 0.0

Index Only Scan using producttype_name_unique on "ProductType" pt_1 (cost=0.15..0.18 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (name = (p_1.type)::text)
182. 0.000 0.000 ↓ 0.0

Index Scan using "Subregion_pkey" on "Subregion" sr_1 (cost=0.14..0.99 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (id = "Market"."subregionId")
183. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..1.07 rows=5 width=16) (actual rows= loops=)

184. 0.000 0.000 ↓ 0.0

Seq Scan on "Region" r_1 (cost=0.00..1.05 rows=5 width=16) (actual rows= loops=)

185. 0.000 0.000 ↓ 0.0

Index Scan using "SubBrand_pkey" on "SubBrand" sb_1 (cost=0.14..0.16 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (id = p_1."subBrandId")
186. 0.000 0.000 ↓ 0.0

Index Only Scan using "Brand_pkey" on "Brand" b_1 (cost=0.14..0.92 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = sb_1."brandId")
187. 0.000 0.000 ↓ 0.0

Index Only Scan using "Form_pkey" on "Form" f_1 (cost=0.14..0.17 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = p_1."formId")
188. 0.000 0.000 ↓ 0.0

Index Only Scan using "Demographic_pkey" on "Demographic" d_1 (cost=0.14..0.17 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = p_1."demographicId")
189. 0.000 0.000 ↓ 0.0

Index Only Scan using "MarketingManaged_pkey" on "MarketingManaged" mm_1 (cost=0.14..0.17 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = p_1."marketingManagedId")
190. 0.000 0.000 ↓ 0.0

Index Only Scan using "MarketingFocus_pkey" on "MarketingFocus" mf_1 (cost=0.14..0.17 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = p_1."marketingFocusId")
191. 0.000 0.000 ↓ 0.0

Hash (cost=1.50..1.50 rows=50 width=20) (actual rows= loops=)

192. 0.000 0.000 ↓ 0.0

Seq Scan on "Currency" c_1 (cost=0.00..1.50 rows=50 width=20) (actual rows= loops=)