OpenTeleDB xstore vs GaussDB ustore表膨胀测试

电信天翼云最近开源了OpenTeleDB,发布了XProxy、XStore、XRaft三大技术

XStore号称通过原位更新技术,把旧数据写入回滚段,垃圾集中进行清理回收,数据存储空间不再膨胀

还可消除对 Vacuum 的依赖,无需再为空间回收与事务冻结而进行频繁维护

那么我们就拿OpenTeleDB和GaussDB做个PK吧,看看OpenTeleDB的XSTORE和GaussDB的USTORE谁更强

OpenTeleDB

复制代码
openteledb

postgres=# \d+
                                     List of relations
 Schema |   Name   | Type  |  Owner   | Persistence | Access method |  Size   | Description 
--------+----------+-------+----------+-------------+---------------+---------+-------------
 public | t_xstore | table | postgres | permanent   | xstore        | 132 MB  | 
 public | test     | table | postgres | permanent   | heap          | 12 MB   | 
 public | test01   | table | postgres | permanent   | heap          | 6104 MB | 
(3 rows)

postgres=# \di+
                                              List of relations
 Schema |      Name       | Type  |  Owner   |  Table   | Persistence | Access method |  Size  | Description 
--------+-----------------+-------+----------+----------+-------------+---------------+--------+-------------
 public | idx_t_xstore_n1 | index | postgres | t_xstore | permanent   | xbtree        | 49 MB  | 
 public | idx_t_xstore_n2 | index | postgres | t_xstore | permanent   | xbtree        | 128 MB | 
(2 rows)

在有长事务情况下,对表t_xstore update,delete,insert 30次

postgres=# \d+
                                     List of relations
 Schema |   Name   | Type  |  Owner   | Persistence | Access method |  Size   | Description 
--------+----------+-------+----------+-------------+---------------+---------+-------------
 public | t_xstore | table | postgres | permanent   | xstore        | 4077 MB | 
 public | test     | table | postgres | permanent   | heap          | 12 MB   | 
 public | test01   | table | postgres | permanent   | heap          | 6104 MB | 
(3 rows)

postgres=# \di+
                                              List of relations
 Schema |      Name       | Type  |  Owner   |  Table   | Persistence | Access method |  Size   | Description 
--------+-----------------+-------+----------+----------+-------------+---------------+---------+-------------
 public | idx_t_xstore_n1 | index | postgres | t_xstore | permanent   | xbtree        | 1397 MB | 
 public | idx_t_xstore_n2 | index | postgres | t_xstore | permanent   | xbtree        | 6548 MB | 
(2 rows)


表膨胀30.89倍
索引1膨胀28.5倍
索引2膨胀51.15倍

GaussDB

复制代码
gaussdb

gaussdb=# \d+
                                                                 List of relations
 Schema |   Name   | Type  |  Owner  |  Size   |                                       Storage                                       | Description 
--------+----------+-------+---------+---------+-------------------------------------------------------------------------------------+-------------
 public | t_ustore | table | gaussdb | 126 MB  | {orientation=row,storage_type=ustore,compression=no,segment=off,parallel_workers=8} | 
 public | test01   | table | gaussdb | 5614 MB | {orientation=row,compression=no,storage_type=USTORE,segment=off}                    | 
 public | test02   | table | gaussdb | 11 MB   | {orientation=row,compression=no,storage_type=USTORE,segment=off}                    | 
(3 rows)

gaussdb=# \di+
                                          List of relations
 Schema |      Name       | Type  |  Owner  |  Table   |  Size  |        Storage        | Description 
--------+-----------------+-------+---------+----------+--------+-----------------------+-------------
 public | idx_t_ustore_n1 | index | gaussdb | t_ustore | 37 MB  | {storage_type=USTORE} | 
 public | idx_t_ustore_n2 | index | gaussdb | t_ustore | 118 MB | {storage_type=USTORE} | 
(2 rows)

在有长事务情况下,对表t_ustore update,delete,insert 30次

gaussdb=# \d+
                                                                 List of relations
 Schema |   Name   | Type  |  Owner  |  Size   |                                       Storage                                       | Description 
--------+----------+-------+---------+---------+-------------------------------------------------------------------------------------+-------------
 public | t_ustore | table | gaussdb | 553 MB  | {orientation=row,compression=no,storage_type=USTORE,segment=off,parallel_workers=8} | 
 public | test01   | table | gaussdb | 5614 MB | {orientation=row,compression=no,storage_type=USTORE,segment=off}                    | 
 public | test02   | table | gaussdb | 11 MB   | {orientation=row,compression=no,storage_type=USTORE,segment=off}                    | 
(3 rows)

gaussdb=# \di+
                                           List of relations
 Schema |      Name       | Type  |  Owner  |  Table   |  Size   |        Storage        | Description 
--------+-----------------+-------+---------+----------+---------+-----------------------+-------------
 public | idx_t_ustore_n1 | index | gaussdb | t_ustore | 1739 MB | {storage_type=USTORE} | 
 public | idx_t_ustore_n2 | index | gaussdb | t_ustore | 9176 MB | {storage_type=USTORE} | 
(2 rows)


表膨胀4.3倍
索引1膨胀47倍
索引2膨胀77倍

结论:在有长事务情况下,OpenTeleDB表膨胀30倍+,GaussDB表膨胀4.3倍,在表膨胀方面GaussDB吊打OpenTeleDB,遥遥领先果然厉害。索引膨胀OpenTeleDB比Gaussdb好些,两款数据库都没解决索引膨胀。

OpenTeleDB的XSTORE是大概率是给超高频的单行update场景使用的,此类场景原生PG死翘翘

相关推荐
DarkAthena2 天前
美式期权二叉树算法 — 七语言实现与交叉验证报告
gaussdb
Gauss松鼠会8 天前
GaussDB数据库统计信息自动收集机制
数据库·经验分享·sql·oracle·gaussdb
Gauss松鼠会8 天前
效率起飞!GaussDB 管理平台(TPOPS)升级指南
服务器·数据库·性能优化·gaussdb·经验总结
Gauss松鼠会9 天前
【GaussDB】GaussDB逻辑操作符入门指南
数据库·性能优化·gaussdb·经验总结·逻辑操作符
Gauss松鼠会12 天前
GaussDB for DWS 数据融合:Oracle数据迁移到GaussDB(DWS)
数据库·oracle·数据库开发·gaussdb
Gauss松鼠会12 天前
GaussDB(DWS)数据融合:云端GaussDB(DWS)迁移
java·服务器·网络·数据库·性能优化·gaussdb
Gauss松鼠会14 天前
【openGauss】openGauss 磁盘引擎之 ustore
java·服务器·开发语言·前端·数据库·经验分享·gaussdb
Navicat中国15 天前
干货整理 | Navicat 高频技术问题 Q&A:PostgreSQL、GaussDB、OceanBase、达梦、MongoDB、金仓、MySQL、麒麟等
postgresql·oceanbase·gaussdb
Gauss松鼠会15 天前
【GaussDB】浅谈SQL与ETL
数据库·数据仓库·sql·etl·gaussdb·经验总结