大数据学习+数据库知识

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

2020-03-16  本文已影响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
测试工具 apache-jmeter-5.2.1

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

背景

大表join连接查询并做聚合。

设计

3张表,2张1000W数据,1张10W数据,join连接查询并做聚合,100个并发连接在10秒内连接,连续主键查询100W次。

准备

drop table if exists t_test04_01;
drop table if exists t_test04_02;
drop table if exists t_test04_03;

create table t_test04_01 (
    id serial,
    id3 int,
    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_test04_01 add CONSTRAINT t_test04_01_pkey primary key (id);
create index idx_t_test04_01_id3 on t_test04_01(id3);


create table t_test04_02 (like t_test04_01 including all);

create table t_test04_03 (
    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_test04_03 add CONSTRAINT t_test04_03_pkey primary key (id);

-- 准备测试数据

insert into t_test04_01(id,id3,state)
select id,trunc(random()*100000) id3,trunc(random()*1000) stat
from generate_series(1,10000000) t(id);  
insert into t_test04_02(id,id3,state)
select id,trunc(random()*100000) id3,trunc(random()*1000) stat
from generate_series(1,10000000) t(id);  
insert into t_test04_03 (id,state)
select id,trunc(random()*1000) stat
from generate_series(1,100000) t(id);
select sum(t1.state),avg(t1.state),sum(t2.state),avg(t2.state)
from t_test04_03 t3
inner join t_test04_01 t1 on t1.id3 = t3.id
inner join t_test04_02 t2 on t2.id = t1.id
where t3.id = ${rNumSw}

配置jmeter

测试结果

上一篇 下一篇

猜你喜欢

热点阅读