It's the sort of thing that would be amenable to testing.
My first instinct, coming from a DW background, would be to materialize all the required values myself. There are a great many optimizations that could be applied to the refresh of a summary table like this, and some of them would allow materialization of all values without grouping by them all.
For example:
You couldn't define your MV like that, but you could certainly use such code as the basis for a faster refresh than the native MV method.Code:with agg_data as (select date_of_month, sum(sales_amt) s_amt from fct_sales group by date_of_month) select ad.date_of_month, d.date_of_quarter, d.date_of_year, ad.s_amt from agg_data ad, dim_date_of_month d where ad.date_of_month = d.date_of_month




Reply With Quote