达梦V8大规模并行处理 MPP,不同场景下查询数据

这篇博客主要展示了在达梦数据库中,主库和从库使用全局与局部参数进行查询时的不同性能表现。通过创建并填充表格t01和t01_hash,然后执行查询计数操作,揭示了不同模式下查询结果的差异,特别是在数据量和查询速度方面。
摘要由CSDN通过智能技术生成

测试架构

主库:10.0.0.31:7236 EP02
从库:10.0.0.32:7237 EP02_S1

===连接主库,用global参数:查集群的全部数据
disql SYSDBA/SYSDBA@10.0.0.31:7236#“{mpp_type=global}”

===连接主库,用global参数:只能查EP02节点存储的
disql SYSDBA/SYSDBA@10.0.0.31:7236#“{mpp_type=local}”

===连接从库,用global参数:只能查EP02_1存储的
disql SYSDBA/SYSDBA@10.0.0.32:7237#“{mpp_type=global}”

===连接从库,用local参数:只能查EP02_1存储的
disql SYSDBA/SYSDBA@10.0.0.32:7237#“{mpp_type=local}”

准备数据


drop table if exists t01;

drop table  if exists t01_hash;


create table t01 (id int);

create table t01_hash (id int,name varchar2(50)) DISTRIBUTED BY HASH (id);



begin
for i in 1..5000 loop
insert into t01 values (i);
end loop;
commit;
end;
/

begin
for i in 1..5000 loop
insert into t01_hash values (i,'C'||i);
end loop;
commit;
end;
/

cat > c.sql << EOF


select count(*) from t01;

select count(*) from t01_hash;


EOF

测试过程


###primary,global模式
disql SYSDBA/SYSDBA@10.0.0.32:7237#"{mpp_type=global}"
[dmdba@dmdbs1 ~]$ 
[dmdba@dmdbs1 ~]$ disql SYSDBA/SYSDBA@10.0.0.32:7237#"{mpp_type=global}"

Server[10.0.0.32:7237]:mode is primary, state is open
login used time : 2.870(ms)
disql V8
SQL> `c.sql
SQL> select count(*) from t01;

LINEID     COUNT(*)            
---------- --------------------
1          5000

used time: 3.951(ms). Execute id is 140815.
SQL> select count(*) from t01_hash;

LINEID     COUNT(*)            
---------- --------------------
1          5000

used time: 4.036(ms). Execute id is 140817.
SQL> 


###primary,local模式
disql SYSDBA/SYSDBA@10.0.0.32:7237#"{mpp_type=local}"
[dmdba@dmdbs1 ~]$ 
[dmdba@dmdbs1 ~]$ disql SYSDBA/SYSDBA@10.0.0.32:7237#"{mpp_type=local}"

Server[10.0.0.32:7237]:mode is primary, state is open
login used time : 1.850(ms)
disql V8
SQL> 
SQL> `c.sql
SQL> select count(*) from t01;

LINEID     COUNT(*)            
---------- --------------------
1          1284

used time: 0.592(ms). Execute id is 491302.
SQL> select count(*) from t01_hash;

LINEID     COUNT(*)            
---------- --------------------
1          1250

used time: 0.511(ms). Execute id is 491303.
SQL> 

###standby,global模式
disql SYSDBA/SYSDBA@10.0.0.31:7236#"{mpp_type=global}"
[dmdba@dmdbs1 ~]$ 
[dmdba@dmdbs1 ~]$ disql SYSDBA/SYSDBA@10.0.0.31:7236#"{mpp_type=global}"

Server[10.0.0.31:7236]:mode is standby, state is open
login used time : 2.139(ms)
disql V8
SQL> `c.sql
SQL> select count(*) from t01;

LINEID     COUNT(*)            
---------- --------------------
1          1284

used time: 1.186(ms). Execute id is 130202.
SQL> select count(*) from t01_hash;

LINEID     COUNT(*)            
---------- --------------------
1          1250

used time: 0.993(ms). Execute id is 130203.
SQL> 
SQL> 
SQL> 
###standby,local模式
disql SYSDBA/SYSDBA@10.0.0.31:7236#"{mpp_type=local}"

[dmdba@dmdbs1 ~]$ disql SYSDBA/SYSDBA@10.0.0.31:7236#"{mpp_type=local}"

Server[10.0.0.31:7236]:mode is standby, state is open
login used time : 3.776(ms)
disql V8
SQL> `c.sql
SQL> select count(*) from t01;

LINEID     COUNT(*)            
---------- --------------------
1          1284

used time: 1.053(ms). Execute id is 132302.
SQL> select count(*) from t01_hash;

LINEID     COUNT(*)            
---------- --------------------
1          1250

used time: 0.764(ms). Execute id is 132303.
SQL> 

测试结论

在这里插入图片描述

达梦在线服务平台:https://eco.dameng.com

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值