当前位置:首页 >> 行情

聊一聊数据源的行存与列存

来源:行情   2024年12月17日 12:16

0 万条历史纪录。

openGauss=# create table custom1 (id integer,name varchar2(20)); CREATE TABLE openGauss=# create table custom2 (id integer,name varchar2(20)) with (orientation = column); CREATE TABLE openGauss=# insert into custom1 select n,'testtt'||n from generate_series(1,500000) n; INSERT 0 500000 openGauss=# insert into custom2 select * from custom1; INSERT 0 500000

我们看下两个列于于的传输维度,相当 Size 列于,可以说明了列于存列于于比引存列于于占用传输维度小的非常多,将近是引存列于于维度的 1/7。

openGauss=# d+ List of relations Schema | Name | Type | Owner | Size | Storage | Deion --------+------------+-------+-------+------------+--------------------------------------+------------- public | custom1 | table | omm | 24 MB | {orientation=row,compression=no} | public | custom2 | table | omm | 3104 kB | {orientation=column,compression=low} |

相当下断开一条从新历史纪录的一段时间,列于存列于于要以致于迟一点。

openGauss=# explain yze insert into custom1 values(1,'zhang3'); QUERY PLAN ----------------------------------------------------------------------------------------------- [Bypass] Insert on custom1 (cost=0.00..0.01 rows=1 width=0) (actual time=0.059..0.060 rows=1 loops=1) -> Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=1) Total runtime: 0.135 ms (4 rows)

openGauss=# explain yze insert into custom2 values(1,'zhang3'); QUERY PLAN ----------------------------------------------------------------------------------------------- Insert on custom2 (cost=0.00..0.01 rows=1 width=0) (actual time=0.119..0.120 rows=1 loops=1) -> Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.001..0.002 rows=1 loops=1) Total runtime: 0.207 ms (3 rows)

仍要续除检验列于于。

openGauss=# drop table custom1; DROP TABLE openGauss=#drop table custom2; DROP TABLE

感兴趣的同学可以自己检验不够多的的场面,比如创建者大宽列于于、update 列于于等场面检验下。

并不能够建议

不够从新格外困难相对:资料如果格外困难不够从新,并不能够引存列于于。 断开格外困难相对:格外困难的更少量断开,并不能够引存列于于。一次断开批量资料,并不能够列于存列于于。 列于于的列于数:一般才则会,如果列于于的配置文件比多数即列于数多(大宽列于于),察看中的限于到的列于不多的才则会,适合于列于传输。如果列于于的配置文件相加相当更少,察看大部分配置文件,那么并不能够引传输相当好。 察看的列于数:如果每次察看时,只限于了列于于的更少数(<50% 总列于数)几个列于,并不能够列于存列于于。(不要问剩下的列于干啥用,甲方说有用就是有用。) 压缩率:列于存列于于比引存列于于压缩率高。但高压缩率则会消耗掉不够多的 CPU 资源。 注意事项

列于存由于多种不尽相同的传输方式则,使用时约束比多数。比如,列于存列于于不拥护运算符、不拥护分解成列于、不拥护创建者全局临时列于于、不拥护外键,拥护的资料种类也则会比引存要更少。使用时能够察看相关联的资料库软件包。

END

这里有最从新开源电脑系统、软件不够从新、技术干货等以下内容

点这里 ↓↓↓ 记得 关注✔ 标星⭐ 哦~

宝芝林寿星补汁能系统调理身体吗
苏州看白癜风去哪个医院
辽宁哪个医院做人流好
西安看白癜风去哪个医院好
湖北白癜风医院哪家好
用血糖仪测血糖准吗
家用选哪种血糖仪比较好
什么血糖仪家用比较好
血糖仪什么型号的准确一些
血糖仪哪个牌子好
友情链接