当前位置:网站首页>KunlunDB查询优化(三)排序下推
KunlunDB查询优化(三)排序下推
2022-06-22 21:23:00 【KunlunBase 昆仑数据库】
前言
前面2篇文章我们介绍KunlunDB的查询优化原理和Project和Filter下推演示(KunlunDB 查询优化(一),KunlunDB查询优化(二)Project和Filter下推),本节讲述排序查询优化之排序下推。
一、order by下推
一条含有order的SQL的执行计划在如下生成过程中,Sort被下推到RemoteScan算子里面。
Sort下推的操作是异步方式,指令在各个数据节点并行执行,过滤数据后,将排序后的结果反馈给计算节点,降低了计算节点的负载。

下面我们来测试查看查询下推的执行计划
为支持排序下推,需要在kunlunDB设置如下如下参数为true:
set enable_remote_orderby_pushdown=true;
测试语句:
select c_zip from customer1 order byc_zip;查看执行计划:
explain select c_zip fromcustomer1 order by c_zip;
根据上面的执行计划,RemoteScan在传达了远程排序操作到每一个相关的存储节点,存储节点将结果反馈给计算节点再做Merge Append。
如果关闭排序下推的特性,执行计划会发生变化,排序操作将在计算节点执行。
演示如下:
set enable_remote_orderby_pushdown=false;排序操作将在计算节点执行:

语句的执行过程:语句在计算节点改写后,下发到2个数据节点执行,从计算节点拉取符合条件的值到计算节点排序,排序后反馈给客户端。
二、性能比对
性能比对环境:
复制下方链接登录kunlunDB在线体验系统:
zettatech.tpddns.cn:8000/ci/index.php/Main/PGList
在SQL框中输入排序操作的语句,按执行键执行。
左边窗口是KunlunDB社区版本的执行信息(社区版不支持排序下推操作),右边窗口是KunlunDB企业版有下推操作的执行信息。

对比可以发现,order by下推后,执行效率提高了(执行时间由4毫秒下降到3毫秒)
项目已开源
【GitHub:】
https://github.com/zettadb
【Gitee:】
https://gitee.com/zettadb
END
边栏推荐
- 【22暑期复建1】 Codeforces Round #791 (Div. 2)
- js读取剪切板的图片
- DCC888 :SSA (static single assignment form)
- xml转义字符对照表
- Customize multi-level list styles in word
- os. When the command line parameter in args[1:] is empty, the internal statement will not be executed
- Dip1000,1 of D
- PHP7.3报错undefined function simplexml_load_string()
- 防抖&节流 加强版
- Webrtc series - 4connection sorting of network transmission
猜你喜欢

Smart data won two annual awards at the second isig China Industrial Intelligence Conference

Install the typescript environment and enable vscode to automatically monitor the compiled TS file as a JS file

Safe and reliable! Tianyi cloud data security management platform passed the evaluation

DCC888 :SSA (static single assignment form)

Optimization - linear programming

Is it difficult to turn weak current into professional network worker? Huawei pre-sales engineers share their own experience

口令安全是什么意思?等保2.0政策中口令安全标准条款有哪些?

2021-08-22

Digital data was invited to participate in Nantong enterprise digital transformation Seminar

优化——线性规划
随机推荐
How to use swagger2
OJ每日一练——跨越2020
数据库访问工具简介
[redisson] source code analysis of multilock
Reddit's discussion on lamda model: it is not stateless. It adopts a dual process. Compared with the way it edits Wikipedia, it doesn't matter whether it has feelings or not
ArcGIS application (20) the ArcGIS grid image symbol system prompts "this dataset does not have valid histogram required for classificati..."
13. Roman numeral to integer
Php7.3 error undefined function simplexml_ load_ string()
Longest word in output string
RedisTemplate使用遇到\x00的问题
Good things to share
【Kubernetes 系列】Kubernetes 概述
c# sqlsugar,hisql,freesql orm框架全方位性能测试对比 sqlserver 性能测试
eslint 简单配置
输出字符串中最长的单词
Freshman girls' nonsense programming is popular! Those who understand programming are tied with Q after reading
Canvas generate Poster
OJ daily practice - word length
Spark SQL Generic Load/Save Functions(2.4.3)
冒泡排序 指针