PostgreSQL码农集散地

屌炸天,PG要干掉Oracle引以为傲的IMCS内存表

参考文档点击文末阅读原文打开; 推荐《最好的PostgreSQL学习镜像》;


屌炸天,PG要干掉Oracle引以为傲的IMCS内存表

神马,刚整合了牛逼的DuckDB又要整全内存Arrow引擎?小PG要逆天啊!先看看HaloDB的满哥贡献的pg_duckdb support 15 feat,PolarDB开源也能跑!

Image

背景

Apache Arrow是一种开放的、独立于语言的列式内存数据格式,用于平面和分层数据并组织用于高效的数据分析操作. arrow被广泛应用于数据湖、数据仓库产品中, 例如DuckDB.

Arrow的特点:

  • 顺序扫描访问的数据邻接性, 所以对某列进行大范围扫描时吞吐特别高.
  • O(1)(恒定时间)随机访问, 任意行随机访问效率一样.
  • SIMD和向量化友好. 充分利用CPU的批量计算, 提升大量数据的计算性能.
  • 可重定位,无需“指针混淆”,允许在共享内存中实现真正的零拷贝访问.

更多Arrow的介绍可参考:

  • https://arrow.apache.org/docs/format/Columnar.html
  • https://arrow.apache.org/blog/2022/10/05/arrow-parquet-encoding-part-1/

Oracle in-memory column store:

  • https://docs.oracle.com/en/database/oracle/oracle-database/23/inmem/intro-to-in-memory-column-store.html

PG这个万精油数据库, 通过table access method可以整合一众存储引擎, 例如duckdb. 现在github上开源了一个pg_arrow, 是不是炸裂了, 作为PG用户, 你可以在PG里创建arrow纯内存表了.

  • https://github.com/mkindahl/pg_arrow

pg_arrow 屌炸了

屌炸了, PG和Oracle一样, 可以通过内存列存来进行分析加速咯.   就是有点费内存.

这个项目的介绍很简单:

In-memory Table Access Method based on Arrow Array format

This is an in-memory table access method with a columnar structure. The columnar structure is based on the Arrow C Data Interface and we store each column in dedicated shared memory segments, one for each buffer according to the Arrow Columnar Format.

使用举例:

create extension arrow;  

  create table test_heap_int(a int, b int);  
create table test_arrow_int(like test_heap_int) using arrow;  

  insert into test_heap_int select a, 2 * a from generate_series(0,10) as a;  
insert into test_arrow_int select * from test_heap_int;  

  select *  
from test_arrow_int full join test_heap_int using (a,b)  
where a is null or b is null;  

  create table test_heap_float(a float, b float);  
create table test_arrow_float(like test_heap_float) using arrow;  

  insert into test_heap_float select a, 2 * a from generate_series(1.1,2.2) as a;  
insert into test_arrow_float select * from test_heap_float;  

  select *  
from test_arrow_float full join test_heap_float using (a,b)  
where a is null or b is null;  

  drop table test_arrow_int, test_heap_int;  
drop table test_arrow_float, test_heap_float;  

我在数据库筑基课会逐渐把所有典型的存储结构都分享一遍, 欢迎关注, 目前分享了行存和行列混存:  

还不快投入PG的怀抱?

本期彩蛋 - 数据库生态工具&国产开源数据库

用好周边工具, 数据库管理水平战胜90%老司机

1、管控软件

云猿生开源的kubeblocks, 如果你要管理很多套并且种类很多的数据库产品, 推荐选择.

  • https://github.com/apecloud/kubeblocks

乘数开源的clup, 专门用来管理PostgreSQL和PolarDB的集群管理软件, 如果你要管理很多套数据库, 推荐选择. 并且clup还提供了企业版、自研的连接池、分布式存储、一体机、备份平台等, 企业可以关注一下.

  • https://www.csudata.com/

若航开源的pigsty, 集成了300多个PG插件的PG集群和PolarDB集群管理软件, 如果你要管理很多套数据库, 并且对插件有特别多的需求, 推荐选择.

  • https://pigsty.cc/zh/

2、审计监控诊断优化

海信聚好看的 DBdoctor, 采用ebpf技术, 在对数据库几乎没有影响的情况下实时监控数据库和服务器的各项指标, 发现和诊断问题根因非常方便.

  • https://www.dbdoctor.cn/

Bytebase 的目标非常远大, 是位于您和数据库之间的中间件。它是数据库 DevOps 的 GitLab/GitHub,专为开发人员、DBA 和平台工程师打造。

  • https://bytebase.cc/docs/introduction/what-is-bytebase/

D-Smart, Oracle老前辈白老大他们搞的, 专注企业级市场, 将业界顶级DBA经验的产品化作品, 产品功能包括数据库监控、诊断、优化等.

  • https://www.modb.pro/db/567140

3、国产数据库IDE

这个关注的人比较少但确是开发者的必备工具,请查看老程序员前辈达刚老师的DeskUI: https://www.deskui.com

4、数据同步&迁移&备份恢复

NineData, 老领导出去创业做的产品, 产品涵盖了数据同步、迁移、备份、比对、devops、chatDBA等.

  • https://www.ninedata.cloud/home

DSG, 非常老牌的数据库同步迁移企业级产品, 支持各种数据库的异构和同构迁移, 用他们的话说, 没有dsg搞不定的迁移, 比goldengate还牛.

  • https://www.dsgdata.com/

除了PolarDB还非常值得关注的几款PG栈国产数据库:

HaloDB(基于PG兼容PostgreSQL、Oracle、MySQL. http://www.halodbtech.com/ )、IvorySQL(基于开源PG兼容PG、Oracle. https://www.ivorysql.org/zh-cn/ )、ProtonBase(云原生分布式数仓. https://protonbase.com/ )、成都文武数据库(https://ww-it.cn)

参考文档点击阅读原文获得


感谢关注我的github (https://github.com/digoal/blog) 及视频号:

Image

彩蛋2:  全国大学生数据库创新设计赛  点击报名