Hello Edward,
Statistical views could be an alternative option to MQT: locate bottlenecks in execution plans of heavy queries referencing the view, where the cardinalities estimated by the optimiser do not match the actual cardinalities, and create statistical views for the corresponding subqueries :
https://www.ibm.com/docs/en/db2/12.1.0?topic=optimization-statishttps://www.ibm.com/docs/en/db2/12.1.0?topic=optimization-statistical-viewstical-views
Hope this helps.
Regards
--
Yves-Antoine Emmanuelli
------------------------------
Yves-Antoine Emmanuelli
------------------------------
-------------------------------------------
Message d'origine:
Envoyé: Fri June 27, 2025 09:56 AM
Depuis: Edward Spencer
Sujet: Problems Refreshing an MQT
In an attempt to get away from a VERY long running view, I opted to move to using an MQT, populating it with the data from that view. However, when I try to perform the refresh, it fails with "The transaction log for the database is full". I know how to increase the logs, and I will do so if there is no other recourse, but I thought I would ask the community if there is something better to do that what I am doing.
This is for our Data Warehouse, and the MQT statement will gather over 112 million rows of data to refresh the table with. That process, itself takes hours before failing. Am I wrong? Is there something better to do than change the View to an MQT? I just feel that this process of refreshing the MQT is taking way to long.
Any ideas would be very appreciated.
(Just for added context, I have performed hours of analysis to improve the performance of the view and have added multiple indexes to improve it, but it is still horribly slow. and unfortunately, I am running DB2 on Windows....and I am not happy about that either).
------------------------------
Edward Spencer
------------------------------