大数据学习+数据库知识

Gauss DB 场景与性能测试之 4 - (OLTP) 多表j

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 (OLTP)

背景

通过多表JOIN提取各个属性表的数据。

设计

10张表,每张表1000W行数据,通过主键join查询,100个并发连接在10秒内连接,连续主键查询100W次。

准备

CREATE  TABLE t_test1 (
    id serial,
    info text DEFAULT 'sfsluiejldksjfslaueijflsdjflsjfleifeiolfjsl'::text,
    state integer DEFAULT 0,
    crt_time timestamp without time zone DEFAULT now(),
    mod_time timestamp without time zone DEFAULT now()
)
WITH (orientation=row, compression=no)
DISTRIBUTE BY HASH(id)
TO GROUP group_version1;
ALTER TABLE t_test1 ADD CONSTRAINT t_test1_pkey PRIMARY KEY (id);

create table t_test3 (like t_test1 including all);
create table t_test4 (like t_test1 including all);
create table t_test5 (like t_test1 including all);
create table t_test6 (like t_test1 including all);
create table t_test7 (like t_test1 including all);
create table t_test8 (like t_test1 including all);
create table t_test9 (like t_test1 including all);
create table t_test10 (like t_test1 including all);
create table t_test11 (like t_test1 including all);

-- 准备测试数据
t_test1表的数据通过单条插入测试用例生成数据。参考Gauss DB 场景与性能测试之 1 - (OLTP) 单条插入

insert into t_test3 select * from t_test1;
insert into t_test4 select * from t_test1;
insert into t_test5 select * from t_test1;
insert into t_test6 select * from t_test1;
insert into t_test7 select * from t_test1;
insert into t_test8 select * from t_test1;
insert into t_test9 select * from t_test1;
insert into t_test10 select * from t_test1;
insert into t_test11 select * from t_test1;
select *
from t_test1 t1
inner join t_test3 t3 on t3.id = t1.id
inner join t_test4 t4 on t4.id = t1.id
inner join t_test5 t5 on t5.id = t1.id
inner join t_test6 t6 on t6.id = t1.id
inner join t_test7 t7 on t7.id = t1.id
inner join t_test8 t8 on t8.id = t1.id
inner join t_test9 t9 on t9.id = t1.id
inner join t_test10 t10 on t10.id = t1.id
inner join t_test11 t11 on t11.id = t1.id
where t1.id = ${rNumQw}

配置jmeter

测试结果

上一篇 下一篇

猜你喜欢

热点阅读