当前位置:网站首页>Optimization of lazyagg query rewriting in parsing data warehouse
Optimization of lazyagg query rewriting in parsing data warehouse
2022-06-25 16:36:00 【InfoQ】
One 、Lazy Agg Rewriting rule
SELECT t2.b, sum(cc) FROM (SELECT b, sum(c) AS cc FROM t1 GROUP BY b) AS s, t2 WHERE s.b=t2.b GROUP BY t2.b;
SELECT t2.b, sum(cc) FROM (SELECT b, c AS cc FROM t1) AS s, t2 WHERE s.b=t2.b GROUP BY t2.b;Two 、GaussDB(DWS) lazyagg Optimize


3、 ... and 、lazyagg Optimize specifications
- The sub query can be a single aggregate query or a query containing aggregate sub set operations . Collection operations only support UNION ALL, Some branch sub queries can be aggregated and eliminated . Subquery must be JOIN One of the tables ( be not in TargetList、Where Clause, etc ).
- Support all external queries Agg The parameter column is contained in the... Of one of its subqueries Agg Function column , The aggregation operation of the sub query can be eliminated .
- Support all kinds of aggregation functions with correct results after eliminating the aggregation operation of sub queries . See the following table for the correctness of aggregation function type results :

- Eliminating is not supported Agg Function type .
- The subquery contains other conditions or operators , Will result in error after rewriting , for example HAVING、window agg、LIMIT、OFFSET、AP function、distinct、recursive etc. .
- Outer layer Agg Parameter column 、GROUP BY Column or JOIN Column contains volatile function , Such as random、timeofday etc. .
- Subquery Agg Out of function 、 External query Agg There are other expressions or function operations in the function , Such as sub query Agg Function column is sum+1、max+max(d), External query Agg Function column is sum(cc+1) etc. .
- For external queries JOIN Column 、GROUP BY Columns or other conditions contain subqueries Agg Function column .
- Subquery in LEFT JOIN、RIGHT JOIN Of inner Edge or FULL JOIN in , And subquery Agg Function is count, External query Agg Function is sum Of .
Four 、 Conclusion
边栏推荐
- 论文笔记:Generalized Random Forests
- 10款超牛Vim插件,爱不释手了
- Navicat premium 15 for MAC (database development tool) Chinese version
- Day_ twelve
- Android修行手册之Kotlin - 自定义View的几种写法
- Go language - lock operation
- In the wechat environment, H5 jumps to the specified page of the applet
- Precautions for function default parameters (formal parameter angle)
- 完美洗牌问题
- Day_ fifteen
猜你喜欢
随机推荐
一文带你搞懂 JWT 常见概念 & 优缺点
Kettle表输入组件精度丢失的问题
Learning notes of rxjs takeuntil operator
Alvaria宣布客户体验行业资深人士Jeff Cotten担任新首席执行官
Catheon gaming appointed mark Aubrey, former Asia Pacific head of Activision Blizzard, as CEO
One minute to familiarize yourself with the meaning of all fluent question marks
2021, committed to better development
Advanced SQL statement 1 of Linux MySQL database
White screen, how fouc is formed, and how to avoid it
About: encryption and decryption of rsa+aes data transmission [chapter], project practice (special summary)
Read mysql45 the next day
普通人的2022春招总结(阿里、腾讯offer)
论文笔记:Generalized Random Forests
Collection overview, array encapsulation
Read AFN through - from the creation of manager to the completion of data parsing
Day_ twelve
GridLayout evenly allocate space
Servlet详解
[Third Party framework] retrofit2 (2) - add point configuration of network access framework
[Third Party framework] retrofit2 (1) of network request framework -- Getting Started Guide









