Before we dive into the detail of how to improve the calculation view performance, it is helpful to learn a little about the way a calculation view responds to a query that calls it.
The calculation engine pre-optimizes queries before they are worked on by the SQL optimizer.
A calculation view is instantiated at runtime when a query is executed. During the instantiation process, the calculation engine simplifies the calculation view into a model that fulfills the requirements of the query. This results in a reduced model that can be further optimized by the calculation engine. For example, it considers settings such as dynamic join, join cardinality and union node pruning.
After this, the SQL optimizer applies further optimizations and determines the query execution plan - for example, it determines the optimal sequence of operations, and also those steps that could be run in parallel.
The instantiation process transforms an original (one that you define) calculation view into an execution model based on a query that is run on top of a calculation view. The generated view is pruned of unnecessary elements from the original calculation view and is technically a column view that references one specific node of the original calculation view.
During the instantiation process, the query and the original calculation model are combined to build the optimized, execution calculation model.