Overview
DWS supports query of materialized views and query rewriting. Materialized view query rewriting allows users to speed up query execution using materialized views automatically, without altering services. This feature lets you add or remove materialized views similar to indexes, without impacting services.
Scenarios
Materialized view query rewriting can avoid complex association, aggregation, and expression calculation operations in the query.
Text matching query rewriting allows queries to match the definition of a materialized view, even if the format and comments differ. It supports complex queries like CTE and window functions. If a complex query performs poorly, creating a materialized view with the same statement can speed up the query.
Query Rewriting Methods
Text matching query rewriting
When the query matches the SQL or syntax tree of the materialized view, you can use the materialized view to rewrite the query.
Setting Materialized View Query Rewriting
The GUC parameter mv_rewrite_rule of DWS specifies the query rewriting mode.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot