Chapter 4. Using the cube model for summary tables optimization 131
SELECT …
GROUP BY (region_id)
UNION ALL
SELECT …
GROUP BY ()
As a rule, DB2 Cube Views recommends the smallest number of MQTs possible
to enhance the performance of the largest number of queries. The number of
MQTs can be minimized by using these complex constructs because DB2 is able
to understand the separate sub-groupings that exist as part of the superset and
optimize a large number of queries that are not an exact match with the MQT
SELECT statement. DB2 Cube Views provides three significant advantages by
using these complex constructs:
Reduction in number of MQTs
Reduction in total disk space
Reduction in refresh times by minimizing base table scans
DB2 can use an M ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.