explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gMT9

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

Unique (cost=5,895,889.81..5,946,367.25 rows=807,639 width=478) (actual rows= loops=)

2.          

CTE q00

3. 0.000 0.000 ↓ 0.0

Sort (cost=2,777,528.45..2,777,628.45 rows=40,000 width=74) (actual rows= loops=)

  • Sort Key: v_bookings_and_breaks_2020_1.filedaten
4. 0.000 0.000 ↓ 0.0

HashAggregate (cost=2,773,870.90..2,774,470.90 rows=40,000 width=74) (actual rows= loops=)

  • Group Key: v_bookings_and_breaks_2020_1.filedaten, v_bookings_and_breaks_2020_1.channel
5. 0.000 0.000 ↓ 0.0

Result (cost=0.47..2,477,654.52 rows=29,621,638 width=19) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Append (cost=0.47..2,181,438.14 rows=29,621,638 width=19) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2020 on v_bookings_and_breaks_2020 v_bookings_and_breaks_2020_1 (cost=0.47..59,911.89 rows=807,630 width=19) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
8. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2019 on v_bookings_and_breaks_2019 v_bookings_and_breaks_2019_1 (cost=0.48..1,093,906.87 rows=14,736,198 width=19) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
9. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2018 on v_bookings_and_breaks_2018 v_bookings_and_breaks_2018_1 (cost=0.48..1,027,575.85 rows=14,077,803 width=19) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
10. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2017 on v_bookings_and_breaks_2017 v_bookings_and_breaks_2017_1 (cost=0.48..6.23 rows=1 width=20) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
11. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2016 on v_bookings_and_breaks_2016 v_bookings_and_breaks_2016_1 (cost=0.48..6.23 rows=1 width=19) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
12. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2015 on v_bookings_and_breaks_2015 v_bookings_and_breaks_2015_1 (cost=0.48..6.23 rows=1 width=20) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
13. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2014 on v_bookings_and_breaks_2014 v_bookings_and_breaks_2014_1 (cost=0.48..6.23 rows=1 width=20) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
14. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2013 on v_bookings_and_breaks_2013 v_bookings_and_breaks_2013_1 (cost=0.48..6.22 rows=1 width=20) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
15. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2012 on v_bookings_and_breaks_2012 v_bookings_and_breaks_2012_1 (cost=0.48..6.21 rows=1 width=19) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
16. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2011 on v_bookings_and_breaks_2011 v_bookings_and_breaks_2011_1 (cost=0.48..6.21 rows=1 width=19) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
17.          

CTE q00_2

18. 0.000 0.000 ↓ 0.0

Sort (cost=2,022,383.21..2,022,483.21 rows=40,000 width=42) (actual rows= loops=)

  • Sort Key: v_bookings_and_breaks_2020_2.filedaten
19. 0.000 0.000 ↓ 0.0

HashAggregate (cost=2,018,825.67..2,019,325.67 rows=40,000 width=42) (actual rows= loops=)

  • Group Key: v_bookings_and_breaks_2020_2.filedaten, v_bookings_and_breaks_2020_2.channel
20. 0.000 0.000 ↓ 0.0

Result (cost=4.40..1,982,287.19 rows=4,871,797 width=14) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Append (cost=4.40..1,933,569.22 rows=4,871,797 width=14) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on v_bookings_and_breaks_2020 v_bookings_and_breaks_2020_2 (cost=4.40..5.57 rows=1 width=14) (actual rows= loops=)

  • Recheck Cond: (statusid = 0)
  • Filter: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year'::i (...)
23. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on v_filedaten_and_status_idx_2020 (cost=0.00..4.40 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (statusid = 0)
24. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on v_bookings_and_breaks_2019 v_bookings_and_breaks_2019_2 (cost=20,897.29..1,013,396.86 rows=2,692,451 width=14) (actual rows= loops=)

  • Recheck Cond: (statusid = 0)
  • Filter: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year'::i (...)
25. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on v_filedaten_and_status_idx_2019 (cost=0.00..20,224.18 rows=2,692,451 width=0) (actual rows= loops=)

  • Index Cond: (statusid = 0)
26. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on v_bookings_and_breaks_2018 v_bookings_and_breaks_2018_2 (cost=16,919.57..920,123.23 rows=2,179,338 width=14) (actual rows= loops=)

  • Recheck Cond: (statusid = 0)
  • Filter: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year'::i (...)
27. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on v_filedaten_and_status_idx_2018 (cost=0.00..16,374.73 rows=2,179,338 width=0) (actual rows= loops=)

  • Index Cond: (statusid = 0)
28. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2017 on v_bookings_and_breaks_2017 v_bookings_and_breaks_2017_2 (cost=0.48..6.23 rows=1 width=15) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
  • Filter: (statusid = 0)
29. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2016 on v_bookings_and_breaks_2016 v_bookings_and_breaks_2016_2 (cost=0.48..6.23 rows=1 width=14) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
  • Filter: (statusid = 0)
30. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2015 on v_bookings_and_breaks_2015 v_bookings_and_breaks_2015_2 (cost=0.48..6.23 rows=1 width=15) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
  • Filter: (statusid = 0)
31. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2014 on v_bookings_and_breaks_2014 v_bookings_and_breaks_2014_2 (cost=0.48..6.23 rows=1 width=14) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
  • Filter: (statusid = 0)
32. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2013 on v_bookings_and_breaks_2013 v_bookings_and_breaks_2013_2 (cost=0.48..6.22 rows=1 width=14) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
  • Filter: (statusid = 0)
33. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2012 on v_bookings_and_breaks_2012 v_bookings_and_breaks_2012_2 (cost=0.48..6.21 rows=1 width=14) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
  • Filter: (statusid = 0)
34. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2011 on v_bookings_and_breaks_2011 v_bookings_and_breaks_2011_2 (cost=0.48..6.21 rows=1 width=14) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 year'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year (...)
  • Filter: (statusid = 0)
35.          

CTE q01

36. 0.000 0.000 ↓ 0.0

CTE Scan on q00 t33_1 (cost=0.00..3,950.00 rows=600 width=100) (actual rows= loops=)

  • Filter: (filedaten = ANY (ARRAY[(((('0001-01-01'::date + (date_part('year'::text, ((('now'::cstring)::date + '1 year'::interval) - '2 years'::interval)) * '1 year'::interval year)) + '11 mons'::interval) + '30 days'::interval))::date, (((('0001-0 (...)
37.          

CTE q1

38. 0.000 0.000 ↓ 0.0

HashAggregate (cost=2.12..2.17 rows=3 width=78) (actual rows= loops=)

  • Group Key: budget.channel
39. 0.000 0.000 ↓ 0.0

Seq Scan on budget (cost=0.00..1.45 rows=45 width=26) (actual rows= loops=)

40.          

CTE q4

41. 0.000 0.000 ↓ 0.0

HashAggregate (cost=273.44..281.30 rows=629 width=58) (actual rows= loops=)

  • Group Key: v_forecasted_values.channel, v_forecasted_values.filedaten
42. 0.000 0.000 ↓ 0.0

Seq Scan on v_forecasted_values (cost=0.00..194.86 rows=6,286 width=31) (actual rows= loops=)

43.          

CTE q55

44. 0.000 0.000 ↓ 0.0

Seq Scan on sales_dev (cost=0.00..131.88 rows=31 width=70) (actual rows= loops=)

  • Filter: ((year)::double precision = ANY (ARRAY[date_part('year'::text, ((('now'::cstring)::date + '1 year'::interval) - '2 years'::interval)), date_part('year'::text, ((('now'::cstring)::date + '1 year'::interval) - '1 year'::interval)), date_par (...)
45.          

CTE q7

46. 0.000 0.000 ↓ 0.0

CTE Scan on q00 v_bookings_and_breaks_1 (cost=0.00..3,953.00 rows=600 width=68) (actual rows= loops=)

  • Filter: (filedaten = ANY (ARRAY[(((('0001-01-01'::date + (date_part('year'::text, ((('now'::cstring)::date + '1 year'::interval) - '2 years'::interval)) * '1 year'::interval year)) + '11 mons'::interval) + '30 days'::interval))::date, (((('0001-0 (...)
47.          

CTE sum_from_budget_weekly

48. 0.000 0.000 ↓ 0.0

Sort (cost=24.53..25.03 rows=198 width=64) (actual rows= loops=)

  • Sort Key: budget_weekly.channel, (sum(budget_weekly.budget_1) OVER (?)), (sum(budget_weekly.budget_2) OVER (?))
49. 0.000 0.000 ↓ 0.0

WindowAgg (cost=11.53..16.98 rows=198 width=64) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

Sort (cost=11.53..12.03 rows=198 width=20) (actual rows= loops=)

  • Sort Key: budget_weekly.channel, budget_weekly.week
51. 0.000 0.000 ↓ 0.0

Seq Scan on budget_weekly (cost=0.00..3.98 rows=198 width=20) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

Sort (cost=1,087,434.78..1,089,453.87 rows=807,639 width=478) (actual rows= loops=)

  • Sort Key: v_bookings_and_breaks_2020.filedaten, (date_part('week'::text, (v_bookings_and_breaks_2020.filedaten)::timestamp without time zone)), (date_part('year'::text, (v_bookings_and_breaks_2020.filedaten)::timestamp without time zone)), v_bookin (...)
53. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=675,428.64..906,329.41 rows=807,639 width=478) (actual rows= loops=)

  • Hash Cond: ((date_part('week'::text, (v_bookings_and_breaks_2020.filedaten)::timestamp without time zone) = (sum_from_budget_weekly.week)::double precision) AND (((v_bookings_and_breaks_2020.channel)::bpchar)::text = sum_from_budget_weekly.ch (...)
54. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=675,421.71..722,544.63 rows=807,639 width=366) (actual rows= loops=)

  • Merge Cond: (((date_part('year'::text, (v_bookings_and_breaks_2020.filedaten)::timestamp without time zone) - '1'::double precision) = ((sd.year)::double precision)) AND (v_bookings_and_breaks_2020.channel = (lower((sd.channel)::text))) (...)
  • Join Filter: ((sd.kw)::double precision = date_part('week'::text, (v_bookings_and_breaks_2020.filedaten)::timestamp without time zone))
55. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=675,260.98..706,567.10 rows=807,639 width=358) (actual rows= loops=)

  • Merge Cond: ((date_part('year'::text, (v_bookings_and_breaks_2020.filedaten)::timestamp without time zone) - '1'::double precision) = ((q55.year)::double precision))
  • Join Filter: (((q55.channel)::bpchar = (v_bookings_and_breaks_2020.channel)::bpchar) AND ((q55.kw)::double precision = date_part('week'::text, (v_bookings_and_breaks_2020.filedaten)::timestamp without time zone)))
56. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=675,259.60..691,775.83 rows=807,639 width=354) (actual rows= loops=)

  • Merge Cond: ((((date_part('year'::text, (v_bookings_and_breaks_2020.filedaten)::timestamp without time zone) - '1'::double precision)) = (date_part('year'::text, (q7.filedaten)::timestamp without time zone))) AND (v_bookings (...)
57. 0.000 0.000 ↓ 0.0

Sort (cost=675,219.91..677,239.01 rows=807,639 width=322) (actual rows= loops=)

  • Sort Key: ((date_part('year'::text, (v_bookings_and_breaks_2020.filedaten)::timestamp without time zone) - '1'::double precision)), v_bookings_and_breaks_2020.channel
58. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=436,066.34..524,833.79 rows=807,639 width=322) (actual rows= loops=)

  • Hash Cond: (((v_bookings_and_breaks_2020.channel)::bpchar)::text = q1.channel)
59. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=436,066.24..520,674.35 rows=807,639 width=282) (actual rows= loops=)

  • Merge Cond: ((v_bookings_and_breaks_2020.channel = t33.channel) AND (date_part('year'::text, ((v_bookings_and_breaks_2020.filedaten)::timestamp without time zone - '1 year'::interval)) = (date_part('year':: (...)
60. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=436,026.55..506,137.53 rows=807,639 width=250) (actual rows= loops=)

  • Merge Cond: ((v_bookings_and_breaks_2020.channel = t3_2.channel) AND (date_part('year'::text, ((v_bookings_and_breaks_2020.filedaten)::timestamp without time zone - '1 year'::interval)) = (date_part(' (...)
61. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=432,169.01..468,234.05 rows=807,639 width=218) (actual rows= loops=)

  • Merge Cond: ((v_bookings_and_breaks_2020.channel = t3.channel) AND ((date_part('year'::text, ((v_bookings_and_breaks_2020.filedaten)::timestamp without time zone - '1 year'::interval))) = (date_ (...)
62. 0.000 0.000 ↓ 0.0

Sort (cost=428,311.47..430,330.57 rows=807,639 width=154) (actual rows= loops=)

  • Sort Key: v_bookings_and_breaks_2020.channel, (date_part('year'::text, ((v_bookings_and_breaks_2020.filedaten)::timestamp without time zone - '1 year'::interval))), (date_part('week'::text (...)
63. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=250,244.91..311,879.50 rows=807,639 width=154) (actual rows= loops=)

  • Merge Cond: ((date_part('week'::text, (v_bookings_and_breaks_2020.filedaten)::timestamp without time zone) = (CASE WHEN (t1_2.filedaten = '2016-04-11'::date) THEN '14'::double precis (...)
64. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=246,387.37..278,214.21 rows=807,639 width=122) (actual rows= loops=)

  • Merge Cond: (((date_part('week'::text, (v_bookings_and_breaks_2020.filedaten)::timestamp without time zone)) = (CASE WHEN (t1.filedaten = '2016-04-11'::date) THEN '14'::double (...)
65. 0.000 0.000 ↓ 0.0

Sort (cost=242,529.83..244,548.93 rows=807,639 width=58) (actual rows= loops=)

  • Sort Key: (date_part('week'::text, (v_bookings_and_breaks_2020.filedaten)::timestamp without time zone)), (date_part('year'::text, (v_bookings_and_breaks_2020.filedaten): (...)
66. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=139,221.57..145,501.11 rows=807,639 width=58) (actual rows= loops=)

  • Merge Cond: (((v_bookings_and_breaks_2020.channel)::bpchar = (q4.channel)::bpchar) AND (v_bookings_and_breaks_2020.filedaten = q4.filedaten))
67. 0.000 0.000 ↓ 0.0

Sort (cost=139,179.75..141,198.85 rows=807,639 width=10) (actual rows= loops=)

  • Sort Key: v_bookings_and_breaks_2020.channel USING <, v_bookings_and_breaks_2020.filedaten
68. 0.000 0.000 ↓ 0.0

Append (cost=0.45..59,936.83 rows=807,639 width=10) (actual rows= loops=)

69. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2020 on v_bookings_and_breaks_2020 (cost=0.45..59,908.80 rows=807,630 width=10) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 y (...)
70. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2019 on v_bookings_and_breaks_2019 (cost=0.46..3.12 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 y (...)
71. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2018 on v_bookings_and_breaks_2018 (cost=0.46..3.12 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 y (...)
72. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2017 on v_bookings_and_breaks_2017 (cost=0.46..3.12 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 y (...)
73. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2016 on v_bookings_and_breaks_2016 (cost=0.46..3.12 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 y (...)
74. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2015 on v_bookings_and_breaks_2015 (cost=0.46..3.12 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 y (...)
75. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2014 on v_bookings_and_breaks_2014 (cost=0.46..3.12 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 y (...)
76. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2013 on v_bookings_and_breaks_2013 (cost=0.46..3.11 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 y (...)
77. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2012 on v_bookings_and_breaks_2012 (cost=0.45..3.11 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 y (...)
78. 0.000 0.000 ↓ 0.0

Index Scan using v_filedatens_year_idx_btree_2011 on v_bookings_and_breaks_2011 (cost=0.45..3.11 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (date_part('year'::text, (filedaten)::timestamp without time zone) = ANY (ARRAY[date_part('year'::text, (('now'::cstring)::date + '1 y (...)
79. 0.000 0.000 ↓ 0.0

Sort (cost=41.82..43.39 rows=629 width=84) (actual rows= loops=)

  • Sort Key: q4.channel USING <, q4.filedaten
80. 0.000 0.000 ↓ 0.0

CTE Scan on q4 (cost=0.00..12.58 rows=629 width=84) (actual rows= loops=)

81. 0.000 0.000 ↓ 0.0

Sort (cost=3,857.54..3,957.54 rows=40,000 width=100) (actual rows= loops=)

  • Sort Key: (CASE WHEN (t1.filedaten = '2016-04-11'::date) THEN '14'::double precision WHEN (t1.filedaten = '2016-04-25'::date) THEN '16'::double precision WHEN (t1.filedat (...)
82. 0.000 0.000 ↓ 0.0

CTE Scan on q00 t1 (cost=0.00..800.00 rows=40,000 width=100) (actual rows= loops=)

83. 0.000 0.000 ↓ 0.0

Sort (cost=3,857.54..3,957.54 rows=40,000 width=68) (actual rows= loops=)

  • Sort Key: (CASE WHEN (t1_2.filedaten = '2016-04-11'::date) THEN '14'::double precision WHEN (t1_2.filedaten = '2016-04-25'::date) THEN '16'::double precision WHEN (t1_2.filedat (...)
84. 0.000 0.000 ↓ 0.0

CTE Scan on q00_2 t1_2 (cost=0.00..800.00 rows=40,000 width=68) (actual rows= loops=)

85. 0.000 0.000 ↓ 0.0

Sort (cost=3,857.54..3,957.54 rows=40,000 width=100) (actual rows= loops=)

  • Sort Key: t3.channel, (date_part('year'::text, (t3.filedaten)::timestamp without time zone)), (CASE WHEN (t3.filedaten = '2016-04-11'::date) THEN '14'::double precision WHEN (t3.filedaten (...)
86. 0.000 0.000 ↓ 0.0

CTE Scan on q00 t3 (cost=0.00..800.00 rows=40,000 width=100) (actual rows= loops=)

87. 0.000 0.000 ↓ 0.0

Sort (cost=3,857.54..3,957.54 rows=40,000 width=68) (actual rows= loops=)

  • Sort Key: t3_2.channel, (date_part('year'::text, (t3_2.filedaten)::timestamp without time zone)), (CASE WHEN (t3_2.filedaten = '2016-04-11'::date) THEN '14'::double precision WHEN (t3_2.filedate (...)
88. 0.000 0.000 ↓ 0.0

CTE Scan on q00_2 t3_2 (cost=0.00..800.00 rows=40,000 width=68) (actual rows= loops=)

89. 0.000 0.000 ↓ 0.0

Sort (cost=39.69..41.19 rows=600 width=68) (actual rows= loops=)

  • Sort Key: t33.channel, (date_part('year'::text, (t33.filedaten)::timestamp without time zone))
90. 0.000 0.000 ↓ 0.0

CTE Scan on q01 t33 (cost=0.00..12.00 rows=600 width=68) (actual rows= loops=)

91. 0.000 0.000 ↓ 0.0

Hash (cost=0.06..0.06 rows=3 width=72) (actual rows= loops=)

92. 0.000 0.000 ↓ 0.0

CTE Scan on q1 (cost=0.00..0.06 rows=3 width=72) (actual rows= loops=)

93. 0.000 0.000 ↓ 0.0

Sort (cost=39.69..41.19 rows=600 width=68) (actual rows= loops=)

  • Sort Key: (date_part('year'::text, (q7.filedaten)::timestamp without time zone)), q7.channel
94. 0.000 0.000 ↓ 0.0

CTE Scan on q7 (cost=0.00..12.00 rows=600 width=68) (actual rows= loops=)

95. 0.000 0.000 ↓ 0.0

Sort (cost=1.39..1.47 rows=31 width=42) (actual rows= loops=)

  • Sort Key: ((q55.year)::double precision)
96. 0.000 0.000 ↓ 0.0

CTE Scan on q55 (cost=0.00..0.62 rows=31 width=42) (actual rows= loops=)

97. 0.000 0.000 ↓ 0.0

Sort (cost=160.72..165.93 rows=2,084 width=20) (actual rows= loops=)

  • Sort Key: ((sd.year)::double precision), (lower((sd.channel)::text))
98. 0.000 0.000 ↓ 0.0

Seq Scan on sales_dev sd (cost=0.00..45.84 rows=2,084 width=20) (actual rows= loops=)

99. 0.000 0.000 ↓ 0.0

Hash (cost=3.96..3.96 rows=198 width=50) (actual rows= loops=)

100. 0.000 0.000 ↓ 0.0

CTE Scan on sum_from_budget_weekly (cost=0.00..3.96 rows=198 width=50) (actual rows= loops=)