hive中not in优化
2024-08-27 01:50:19
比如:A,B两表,找到ID字段中,存在A表,但不存在B表的数据。
A表共13w,去重后3w, B表共2W,且有索引 not in,易理解,效率低,时间:1.395s
left...join...on ,B.id isnull 时间:0.739s
效率高,时间:0.57s
方法一
select distinct A.id from A where A.id not in(select id from B)
方法二
select A.ID from A left join B on A.ID=B.ID where B.ID is null
方法三
select * from A where (select count(1) as num from B where A.ID = B.ID) = 0
最新文章
- 使用IntelliJ IDEA和Maven构建Java web项目并打包部署
- 通信服务器群集——跨服务器通信Demo(源码)
- 高校手机签到系统——第一部分Authority权限系统(下)
- Linux prerouting和postrouting的区别
- recordcount
- 【MySQL】DNS与MHA/ZABBIX构建的高可用MySQL
- UML类图常见关系总结
- JavaScript--正则表达式(笔记)
- asp.net中几个网页跳转的方法及区别
- 【转】#include_next <;filename.h>;
- jedis访问redis学习笔记
- 配置一个servlet程序
- delphi显示hello world 和退出程序
- (三十八)从私人通讯录引出的细节II -数据逆传 -tableView点击 -自定义分割线
- powershell 函数, foreach中格式化
- web.xml:<;url-pattern>;
- MPLS笔记
- python 打印 emoji
- shiny: Web Application Framework for R
- 启动Activiti项目报错:org.activiti.engine.ActivitiObjectNotFoundException: no deployed process definition found with id &#39;22501&#39;