Hi, stay with me here
Problem
The run time of my calculation view tree is approximately 3 seconds, however, the CPU usage is huge and when it is run simultaneously by multiple users, the time it takes slows very very quickly (30sec+ run time).
It is currently structured such that the base holding is called 66 times. I am wondering how I can reduce this number of calls and improve performance across the board.
I have considered:
- cardinality on joins
- filtering the dataset at the lowest, earliest level
- a combination of proc calls to generate a table that is inserted into after SV section is calculated the first time, and then the DT's call that table, reducing the dynamic calculation calls during run time
Overview
I have a 3 calculation views that is structured as such
BASE (500 - 700ms run time)
SQL Script (calls BASE 6x)
UNION 11 DTs (calls SQL Script)
Additional Information for Overview
-The base view has been optimized with attribute views, cardinality on joins as well as filters at a low level.
-The SQL Script calls the base holding, and assigns 3 calculated columns, the first 2 are consistent the third is not mutually exclusive and therefore I have utilized union calls on the base holding to generate multiple rows with a different value for the 3rd calculated column
Ex.
(CC stands for Calculated column)
Base Holding
Row 1
Row 2
Row 3
SQL Script Output
Row 1 [CC1] [CC2] [CC3 - A]
Row 1 [CC1] [CC2] [CC3 - B]
Row 2 [CC1] [CC2] [CC3 - A]
Row 2 [CC1] [CC2] [CC3 - C]
Row 2 [CC1] [CC2] [CC3 - D]
Row 3 [CC1] [CC2] [CC3 - A]
- then I have 11 decision tables that then call this SQL Script and then they are all unioned to generate the output
- as there are 11 decision tables and the SQL script calls the base holding 6 times, 6 x 11 = 66 times