当前位置:网站首页>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
边栏推荐
- 双重跨域:Access-Allow-Origin header contains multiple values“*, *”,but only one is allowed
- Spark RDD Programming Guide(2.4.3)
- 14. 最长公共前缀
- DML:Data Manipulation Language 数据操纵语言
- Ensure database and cache consistency
- ArcGIS application (20) the ArcGIS grid image symbol system prompts "this dataset does not have valid histogram required for classificati..."
- 【ARM】讯为rk3568开发板lvds屏设置横屏显示
- 同步电路与跨时钟域电路设计2——多bit信号的跨时钟域传输(FIFO)
- Smart data won two annual awards at the second isig China Industrial Intelligence Conference
- flutter外包,承接flutter项目
猜你喜欢

Synchronization circuit and cross clock domain circuit design 2 -- cross clock domain transmission (FIFO) of multi bit signals

C language -- 17 function introduction

Reverse proxy haproxy

PHP7.3报错undefined function simplexml_load_string()

Tp5.1 upload excel file and read its contents

Spark RDD Programming Guide(2.4.3)

Flutter outsourcing, undertaking flutter project

07 项目成本管理

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

异步FIFO
随机推荐
周国华 读书随记
Dml:data manipulation language
Various schemes for lazy loading of pictures
js读取剪切板的图片
Summary of transport layer knowledge points
tp5.1解决跨域
Spark SQL Generic Load/Save Functions(2.4.3)
js图片分辨率压缩
OJ daily practice - spanning 2020
OJ每日一练——找第一个只出现一次的字符
After passing the hcip exam, I still failed to change my career. What do professional network workers value most
Enterprise digitalization is not a separate development, but a comprehensive SaaS promotion
Optimization - linear programming
Smart data won two annual awards at the second isig China Industrial Intelligence Conference
IPV4的未来替代品!一文读懂IPV6的优势特点和地址类型
对 cookie 的添加/获取和删除
Using the hbuilder x editor to install a solution for terminal window plug-ins that are not responding
Unity: use ray to detect objects
Spark SQL accessing JSON and JDBC data sources
获取鼠标移动的方向