当前位置:网站首页>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
边栏推荐
猜你喜欢

【機器學習】基於多元時間序列對高考預測分析案例

3.条件概率与独立性

A TDD example

根据先序遍历和中序遍历生成后序遍历

20省市公布元宇宙路线图
![[100 questions of Blue Bridge Cup intensive training] scratch command mobile Blue Bridge Cup scratch competition special prediction programming question intensive training simulation exercise question](/img/45/9955c9a5edeaa681f3fa8ce4041bfe.png)
[100 questions of Blue Bridge Cup intensive training] scratch command mobile Blue Bridge Cup scratch competition special prediction programming question intensive training simulation exercise question

Dino: Detr with improved detecting anchor boxes for end to end object detection

Unity技术手册 - 生命周期旋转RotationOverLifetime-速度旋转RotationBySpeed-外力ExternalForces

完美洗牌问题

1-8Vmware中的文件共享
随机推荐
When inputting text in the shutter textfield, if the page is refreshed, the cursor position will change.
这项最新的调查研究,揭开多云发展的两大秘密
Webgl and webgpu comparison [4] - uniform
DOM event flow, event delegate
数字经济时代文化消费新特征
Beginner bug set
Dino: Detr with improved detecting anchor boxes for end to end object detection
First knowledge of database
1-8Vmware中的文件共享
White screen, how fouc is formed, and how to avoid it
Cocoapods installation in 2021
Day_ eleven
Built in function globals() locals()
Detailed explanation of IVX low code platform series -- Overview (I)
20省市公布元宇宙路线图
一个 TDD 示例
Android修行手册之Kotlin - 自定义View的几种写法
cmd。。。。。。
Catheon Gaming任命Activision Blizzard前亚太区负责人Mark Aubrey担任首席执行官
Rxjs TakeUntil 操作符的学习笔记