当前位置:网站首页>KunlunDB 查询优化(一)
KunlunDB 查询优化(一)
2022-06-22 21:23:00 【KunlunBase 昆仑数据库】
前言
前面介绍了KunlunDB的架构以及技术,应该会有朋友好奇其查询优化的过程吧,本篇章带来的是查询优化这一块的具体流程介绍,后续也会出一篇实例来举例演示。
当然后续也会对KunlunDB的其它技术方面(比如数据分片这些)做实例演示,以方便大家去了解KunlunDB。
查询优化流程
KunlunDB是计算和存储分离的分布式数据库系统,当一条查询SQL发送到KunlunDB任一计算节点(CN)时,KunlunDB语法解析器(Parser)首先会对原始查询文本做出解析以及一些简单的合法性验证,之后会对查询做逻辑优化:如查询重写,分区修剪,列裁剪,谓词下推等。
KunlunDB在逻辑优化过程中会采取最大下推的策略。
计算下推不但可以避免CN和DN间数据网络交互还可以充分利用多分片并发执行的能力和各个DN资源,加速查询。
优化后的算子分为两类:
可以下推的算子:RemoteScan将该算子推送到对应的数据节点上执行,执行完成后拉取相应的数据到计算节点做后继处理。支持下推的算子包括:过滤条件,如WHERE或HAVING中的条件。聚合算子,如COUNT,GROUP BY等,会分成两阶段进行聚合计算。排序算子,如ORDER BY,JOIN和子查询。Project,投影操作。Distinct排重。
无法下推的部分算子:如跨 shard 的join,需要将数据从数据节点拉取到计算节点做计算,优化器会选择最优的方式来执行,如选择合适的并行度策略等
全局执行流程如下:

优化流程如下:

最大下推策略如下:



综述:为获取最大性能,在定义分区键时要充分考虑业务在执行SQL 语句的场景,以最大限度避免跨节点数据操作。
项目已开源
【GitHub:】
https://github.com/zettadb
【Gitee:】
https://gitee.com/zettadb
-END
边栏推荐
- js防止PC端复制正确的链接
- Spark SQL Start(2.4.3)
- OJ每日一练——跨越2020
- Leakcanary source code (2)
- 剑指 Offer 11. 旋转数组的最小数字
- 异步FIFO
- Install the typescript environment and enable vscode to automatically monitor the compiled TS file as a JS file
- WebRTC系列-网络传输之4Connection排序
- C sqlsugar, hisql, FreeSQL ORM framework all-round performance test vs. sqlserver performance test
- Webrtc series - 4connection sorting of network transmission
猜你喜欢

07 项目成本管理

OJ daily practice - filter extra spaces

'dare not doubt the code, but have to doubt the code 'a network request timeout analysis

MySQL master-slave synchronization and its basic process of database and table division

Freshman girls' nonsense programming is popular! Those who understand programming are tied with Q after reading

Common operations of sourcetree version management

wallys/WiFi6 MiniPCIe Module 2T2R 2 × 2.4GHz 2x5GHz

Ensure database and cache consistency

What does password security mean? What are the password security standard clauses in the ISO 2.0 policy?

Learning the interpretable representation of quantum entanglement, the depth generation model can be directly applied to other physical systems
随机推荐
WebRTC系列-网络传输之4Connection排序
tp5.1解决跨域
斐波那契数列合集
js判断浏览器是否打开了控制台
js图片分辨率压缩
js读取剪切板的图片
【ARM】讯为rk3568开发板lvds屏设置横屏显示
Optimization - linear programming
Use smart doc to automatically generate interface documents
启牛app下载证券开户,是安全的吗?有风险嘛?
Ensure database and cache consistency
Learning the interpretable representation of quantum entanglement, the depth generation model can be directly applied to other physical systems
[arm] it is reported that horizontal display is set for LVDS screen of rk3568 development board
企业数字化不是各自发展,而是全面SaaS化推进
SSH method 2 for adding node nodes in Jenkins
07 项目成本管理
Stop using system Currenttimemillis() takes too long to count. It's too low. Stopwatch is easy to use!
OJ daily practice - sorting and naming
OJ daily practice - delete word suffixes
uniapp 修改数组属性,视图不更新