CTE Materialization
In some cases, users may execute repeated queries containing the same CTE subquery. Additionally, different users may be unaware that they are using the same computation logic. To improve user computing efficiency, reduce redundant computation, and accelerate queries, AI DataLake provides the CTE materialization feature, which can automatically create materialized views for CTEs.
- Enabling CTE materialization
After enabling this feature in a SQL statement, the system will perform the following operations:
- CTE subquery identification and compliance check: Identifies CTE subqueries in the query and extracts only those that meet the criteria for materialization. Refer to section "Limitations" for specific qualifying criteria.
- Automatic creation of materialized views: Based on the identification results from the first step, materializes the qualifying CTE subqueries.
- Query rewriting: Uses the query rewriting function of the CTE MV to rewrite the CTE subquery to read data directly from the CTE materialized view table created above.
What is your overall rating for this page?
Thank 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