PostgreSQL 11 preview - JIT接口放开

标签

PostgreSQL , LLVM , JIT , 向量计算


背景

LLVM对大量数据运算(比如说where条件中过滤大量的数据,聚合计算大量的数据等)的效率提升非常的明显。

pic

原理参考

《分析加速引擎黑科技 - LLVM、列存、多核并行、算子复用 大联姻 - 一起来开启PostgreSQL的百宝箱》

PostgreSQL 11的JIT接口正在进行打磨,完善。借助LLVM,更多的并行计算的完善,PostgreSQL 11又会有一个质的飞越。解决企业OLTP和OLAP混合使用的需求。做到一个产品,解决小事务和大数据量密集计算的混合需求。

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=2a0faed9d7028e3830998bd6ca900be651274e27

Add expression compilation support to LLVM JIT provider.  
author	Andres Freund <andres@anarazel.de>	  
Tue, 20 Mar 2018 17:20:46 +0800 (02:20 -0700)  
committer	Andres Freund <andres@anarazel.de>	  
Fri, 23 Mar 2018 05:45:59 +0800 (14:45 -0700)  
commit	2a0faed9d7028e3830998bd6ca900be651274e27  
tree	0ab54ad8ac5c5d97d7a4dcee4c2d99c7959af2f6	tree | snapshot  
parent	7ced1d1247286399df53823eb76cacaf6d7fdb22	commit | diff  
Add expression compilation support to LLVM JIT provider.  
  
In addition to the interpretation of expressions (which back  
evaluation of WHERE clauses, target list projection, aggregates  
transition values etc) support compiling expressions to native code,  
using the infrastructure added in earlier commits.  
  
To avoid duplicating a lot of code, only support emitting code for  
cases that are likely to be performance critical. For expression steps  
that aren't deemed that, use the existing interpreter.  
  
The generated code isn't great - some architectural changes are  
required to address that. But this already yields a significant  
speedup for some analytics queries, particularly with WHERE clauses  
filtering a lot, or computing multiple aggregates.  
  
Author: Andres Freund  
Tested-By: Thomas Munro  
Discussion: https://postgr.es/m/20170901064131.tazjxwus3k2w3ybh@alap3.anarazel.de  
  
Disable JITing for VALUES() nodes.  
  
VALUES() nodes are only ever executed once. This is primarily helpful  
for debugging, when forcing JITing even for cheap queries.  
  
Author: Andres Freund  
Discussion: https://postgr.es/m/20170901064131.tazjxwus3k2w3ybh@alap3.anarazel.de  

参考

《分析加速引擎黑科技 - LLVM、列存、多核并行、算子复用 大联姻 - 一起来开启PostgreSQL的百宝箱》

《PostgreSQL VOPS 向量计算 + DBLINK异步并行 - 单实例 10亿 聚合计算跑进2秒》

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值