Using aggregations
From a data analytics viewpoint, the concept of aggregation tables has been around for a long time. The concept was widely used in SQL Server Analysis Service Multi-Dimensional. The way aggregation tables work is simple: we aggregate the data at a particular grain and make it available in the data model. Already aggregating the data that's available in the model usually translates into better performance at runtime. However, the aggregation typically happens at a different level of granularity. Therefore, we change the granularity of the base table. Now, you may be wondering, so what if the business needs to drill down to a lower granular level of data? The answer is that we need to keep the base table available in the data model. We aggregate the base table at a different granular level in a new table. Then, we implement a control mechanism to detect the level of granularity that the user is at. If the data is available at the aggregated level, the calculation...