当前位置:网站首页>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
边栏推荐
- Message format of Modbus (PLC)
- Read mysql45 lecture - index
- Day21 multithreading
- Navicat premium 15 for MAC (database development tool) Chinese version
- Kettle表输入组件精度丢失的问题
- Shuttle pop-up returns to the upper level
- 【機器學習】基於多元時間序列對高考預測分析案例
- 炮打司令部,别让一个UI框架把你毁了
- The database records are read through the system time under the Android system, causing the problem of incomplete Reading Records!
- 心楼:华为运动健康的七年筑造之旅
猜你喜欢
Advanced SQL statement 1 of Linux MySQL database
The paid video at station B caused the up master to lose more than ten thousand fans
Educational administration system development (php+mysql)
This latest research has revealed two secrets of cloudy development
Navicat Premium 15 for Mac(数据库开发工具)中文版
Based on neural tag search, the multilingual abstracts of zero samples of Chinese Academy of Sciences and Microsoft Asiatic research were selected into ACL 2022
Coredata data persistence
Dino: Detr with improved detecting anchor boxes for end to end object detection
20省市公布元宇宙路线图
Detailed explanation of IVX low code platform series -- Overview (I)
随机推荐
flutter
Perfect shuffle problem
mysql整体架构和语句的执行流程
WPF开发随笔收录-心电图曲线绘制
Day_ ten
炮打司令部,别让一个UI框架把你毁了
Once the code was encrypted by the company's computer, the compilation failed
_ 19_ IO stream summary
Prototype chain analysis
[problem solving] dialogfragment can not be attached to a container view
心樓:華為運動健康的七年築造之旅
Common APIs and exception mechanisms
Read mysql45 lecture - index
【 apprentissage automatique】 cas de prévision et d'analyse de l'examen d'entrée à l'Université basé sur des séries chronologiques multiples
心楼:华为运动健康的七年筑造之旅
論文筆記:LBCF: A Large-Scale Budget-Constrained Causal Forest Algorithm
Cocoapods installation in 2021
绕过技术聊'跨端'......
Detailed explanation of IVX low code platform series -- Overview (I)
First knowledge of database