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死翘翘

相关推荐
DarkAthena14 小时前
【GaussDB】数据静止状态下同一个SQL或同一个存储过程执行第6次报错的问题排查
数据库·sql·gaussdb
人工智能知识库2 天前
华为HCCDP-GaussDB工作级开发者题库(带详细解析)
华为·gaussdb·hccdp-gaussdb·工作级开发者认证
robinson19882 天前
测试崖山-DM8-GaussDB-OpenTeleDB数据库在长事务下表和索引是否膨胀
达梦·表膨胀·gaussdb·openteledb·崖山
Gauss松鼠会4 天前
【GaussDB】从 sqlplus 到 gsql:Shell 中执行 SQL 文件方案的迁移与改造
数据库·sql·database·gaussdb
Gauss松鼠会4 天前
【GaussDB】跨用户调用已授权的存储过程,可能会在存储过程内SQL的自定义函数表达式里报错没有权限
数据库·sql·database·gaussdb
云和数据.ChenGuang4 天前
openGauss赋能新能源汽车智能制造——比亚迪MES系统数据库国产化升级案例
数据库·汽车·opengauss·gaussdb·数据库权限管理
云和数据.ChenGuang5 天前
GaussDB 期末考试题与面试题
数据库·opengauss·gaussdb·数据库期末试题
Neolnfra7 天前
openGauss部署配置指南
数据库·opengauss·gaussdb
DarkAthena8 天前
【GaussDB】跨用户调用已授权的存储过程,可能会在存储过程内SQL的自定义函数表达式里报错没有权限
数据库·sql·gaussdb
DarkAthena10 天前
【GaussDB】从 sqlplus 到 gsql:Shell 中执行 SQL 文件方案的迁移与改造
数据库·sql·oracle·gaussdb