Chapter 8. Optimization and performance tuning 233
Number of recommended in-memory aggregates from the same,
corresponding advisor result that the aggregate can cover
This information can be used to identify database aggregates that can accelerate the loading
of in-memory aggregates, because they can satisfy this number of in-memory aggregates, if
the in-memory aggregates from the same advisor result are used.
Database aggregates that cover zero in-memory aggregates can still provide performance
benefits because queries against aggregate tables are faster than those against the
underlying warehouse tables:
* Number of recommended in-memory aggregates that this aggregate can cover: 0
Example of the SQL that illustrates how to aggregate the data
Example 8-9 is not an executable SQL script to create database aggregate tables. It is an
example of SQL that can aggregate the data and be used as guidance. The DBA can take
this information and choose which aggregates to actually create. The DBA might even decide
to modify the SQL to create a subset of the aggregate to contain only a certain subset of
members instead of including the entire level, such as specific years from the Time
dimension.
Example 8-9 SQL that illustrates how to aggregate the data
SELECT
"GO_REGION_DIM"."REGION_CODE" AS "Region_code",
"GO_BRANCH_DIM"."COUNTRY_CODE" AS "Country_code",
"GO_BRANCH_DIM"."BRANCH_KEY" AS "Branch_key",
"SLS_ORDER_METHOD_DIM"."ORDER_METHOD_KEY" AS
"Order_method_key",
"MRK_CAMPAIGN_LOOKUP"."CAMPAIGN_CODE" AS "Campaign_code",
"MRK_PROMOTION_DIM"."PROMOTION_KEY" AS "Promotion_key",
SUM("SLS_SALES_FACT"."QUANTITY") AS "Quantity",
SUM("SLS_SALES_FACT"."SALE_TOTAL") AS "Revenue",
SUM("SLS_SALES_FACT"."GROSS_PROFIT") AS "Gross_profit"
FROM
"GOSALESDW"."EMP_EMPLOYEE_DIM" "EMP_EMPLOYEE_DIM"
INNER JOIN "GOSALESDW"."GO_BRANCH_DIM" "GO_BRANCH_DIM"
ON "EMP_EMPLOYEE_DIM"."BRANCH_CODE" = "GO_BRANCH_DIM"."BRANCH_CODE"
INNER JOIN "GOSALESDW"."SLS_SALES_FACT" "SLS_SALES_FACT"
ON "EMP_EMPLOYEE_DIM"."EMPLOYEE_KEY" = "SLS_SALES_FACT"."EMPLOYEE_KEY"
INNER JOIN "GOSALESDW"."GO_REGION_DIM" "GO_REGION_DIM"
ON "GO_REGION_DIM"."COUNTRY_CODE" = "GO_BRANCH_DIM"."COUNTRY_CODE"
INNER JOIN "GOSALESDW"."MRK_PROMOTION_DIM" "MRK_PROMOTION_DIM"
ON "MRK_PROMOTION_DIM"."PROMOTION_KEY" =
"SLS_SALES_FACT"."PROMOTION_KEY"
INNER JOIN "GOSALESDW"."SLS_ORDER_METHOD_DIM"
"SLS_ORDER_METHOD_DIM"
ON "SLS_ORDER_METHOD_DIM"."ORDER_METHOD_KEY" =
"SLS_SALES_FACT"."ORDER_METHOD_KEY"
INNER JOIN "GOSALESDW"."MRK_CAMPAIGN_LOOKUP"
"MRK_CAMPAIGN_LOOKUP"
ON "MRK_PROMOTION_DIM"."CAMPAIGN_CODE" =
"MRK_CAMPAIGN_LOOKUP"."CAMPAIGN_CODE"
GROUP BY
"GO_REGION_DIM"."REGION_CODE",
"GO_BRANCH_DIM"."COUNTRY_CODE",
"GO_BRANCH_DIM"."BRANCH_KEY",