大数据学习+数据库知识

Gauss DB 场景与性能测试之 6- (OLAP) 大表OU

2020-03-17  本文已影响0人  Kindey_S

环境

server端说明 描述
服务器 华为泰山 2280 v2
操作系统 Cent OS 7.6 aarch64
数据库版本 GaussDB_200_6.5.1_RHEL_ARM64
cline说明 描述
测试机 PC【CPU*8 内存*16G 硬盘*512G(ssd)】
操作系统 win10
测试工具 Data Studio 6.5.1

场景 - 大表JOIN统计查询 (OLAP)

背景

outer join 是我们在业务中最常使用的查询格式之一,尤其在OLAP类型的系统中,更是会经常出现大数据量多个数据outer join来做统计汇总,因此一款数据库能否高效支撑大表outer join是衡量是否有效支撑OLAP业务的重要指标

设计

两张表,A表100W数据,B表1000W数据。B表中包含A中的80W条数据。
测试用例:

  1. A表中包含B表中数据条数
  2. A表中不包含B表中数据条数
  3. B表中包含A表中数据条数
  4. B表中不包含A表中数据条数

1用户并发,连续查询100次。

准备

drop table if exists t_test06_01;
drop table if exists t_test06_02;

create table t_test06_01 (
    id serial,
    info text default 'sfsluiejldksjfslaueijflsdjflsjfleifeiolfjsl'::text,
    state integer default 0,
    create_time timestamp without time zone default now(),
    modify_time timestamp without time zone default now()
)
with (orientation=row, compression=no)
DISTRIBUTE BY HASH(id)
TO GROUP group_version1;
alter table t_test06_01 add CONSTRAINT t_test06_01_pkey primary key (id);

create table t_test06_02 (like t_test06_01 including all);

-- 准备测试数据

insert into t_test06_01(id) select id from generate_series(1,1000000) t(id);
insert into t_test06_02(id) select 200000+id from generate_series(1,10000000) t(id); 
select count(1)
from t_test06_01 a
left join t_test06_02 b on b.id = a.id
where b.id is null;

select count(1)
from t_test06_01 a
left join t_test06_02 b on b.id = a.id
where b.id is not null;

select count(1)
from t_test06_02 b
left join t_test06_01 a on a.id = b.id
where a.id is null;

select count(1)
from t_test06_02 b
left join t_test06_01 a on a.id = b.id
where a.id is not null;

配置jmeter

测试结果

上一篇 下一篇

猜你喜欢

热点阅读