当前位置:网站首页>【StoneDB子查询优化】subquery子查询-优化exists场景的join查询优化器的处理-100GB数据量测试
【StoneDB子查询优化】subquery子查询-优化exists场景的join查询优化器的处理-100GB数据量测试
2022-08-05 19:52:00 【51CTO】
摘要:
说明如何优化exists的join查询优化器的处理
核心函数:TwoDimensionalJoiner::ChooseJoinAlgorithm
选择join优化器问题分析:
- 仅判定join simple场景,未判断exists子句
- cond[0].IsType_JoinSimple() 如果走入了else分支,相当于被执行了两次

ChooseJoinAlgorithm函数优化:
- 加入exists的判定, 以 IsType_JoinSimple 和 == common::Operator::O_EQ条件对待
- 优化代码结构, 清理冗余的cond[0].IsType_JoinSimple()执行
- 其他逻辑不做任何修改
代码优化后exists场景分析:
- 如果未开启强制hash join查询, 且cond.Size() == 1, 则进行JTYPE_MAP查询
- 需要强制开启hash join才可进入hash join查询, 当前测试不开启强制的hash join. 以JTYPE_MAP进行测试
MAP子查询耗时:
MAP子查询对比之前的子查询耗时:

JTYPE_MAP逻辑的火焰图

强制开启hash join优化, 对比同样场景下与map查询的区别
HASH子查询耗时:
HASH子查询的火焰图:

边栏推荐
- 如何推进质量内建?如何设置质量门禁?
- 分布式系列之分布式分析计算引擎Spark解析
- 如何借助数字签名保护文档安全性
- mysql operations, constraints, indexes
- VMware - clone virtual machine
- Understand the recommendation system in one article: Recall 08: Two-tower model - online service requires offline storage of item vectors, model update is divided into full update and incremental upda
- 第01篇:分布式注册中心
- 分享几个YYDS的Pycharm插件
- How to change the boot sound of Win11?
- The method of connecting to the local mysql8.0.30 database in the docker container
猜你喜欢
随机推荐
MySQL8016 expire_logs_days参数不生效
加密熊市为企业并购提供机遇!野心勃勃or救世主?唯一真理便是利益至上!
Make a Reliable Delay Queue with Redis
esp32 bluetooth手机蓝牙控制板子自带灯熄灭
软件测试基础理论(2)
01 thinkphp6的前期开发准备《ThinkPHP6 入门到电商实战》
如何推进质量内建?如何设置质量门禁?
Summary of Vim Commands
falco 【1】规则
大屏可视化工具腾讯云图
方舟生存进化下载服务器文件及搜服方法
151. 颠倒字符串中的单词-双指针法
第04篇:Guava-retry重试组件
VMware-克隆虚拟机
Basic application of JSP
C language programming introduction to learn six steps, six steps to take you into the C language
2022新书 | 理解深度学习,巴斯大学教授Simon J.D. Prince撰著
redis 发布订阅(PubSub),深入解读
新手程序员,买一台个人服务器究竟都能做哪些事呢?
HCIP第十八天笔记









