跳到主要内容

TPC-DS Benchmark

TPC-DS(Transaction Processing Performance Council Decision Support Benchmark)是一个以决策支持为重点的基准测试,旨在评估数据仓库和分析系统的性能。它是由 TPC(Transaction Processing Performance Council)组织开发的,用于比较不同系统在处理复杂查询和大规模数据分析方面的能力。

TPC-DS 的设计目标是模拟现实世界中的复杂决策支持工作负载。它通过一系列复杂的查询和数据操作来测试系统的性能,包括联接、聚合、排序、过滤、子查询等。这些查询模式涵盖了从简单到复杂的各种场景,如报表生成、数据挖掘、OLAP(联机分析处理)等。

本文档主要介绍 Doris 在 TPC-DS 1000G 测试集上的性能表现。

在 TPC-DS 标准测试数据集上的 99 个查询上,我们基于 Apache Doris 进行了测试。

1. 硬件环境

硬件配置说明
机器数量4 台阿里云g9i实例(1 个 FE,3 个 BE)
CPUIntel® Xeon® Granite Rapids 32 核
内存128G
磁盘阿里云 ESSD (PL0)

2. 软件环境

  • Doris 部署 3BE 1FE
  • 内核版本:Linux version 5.15.0-101-generic
  • 操作系统版本:Ubuntu 20.04 LTS (Focal Fossa)
  • JDK:openjdk 17.0.2

3. 测试数据量

整个测试模拟生成 TPC-DS 1000G 的数据分别导入到 Apache Doris 进行测试,下面是表的相关说明及数据量。

TPC-DS 表名行数
customer_demographics1,920,800
reason65
warehouse20
date_dim73,049
catalog_sales1,439,980,416
call_center42
inventory783,000,000
catalog_returns143,996,756
household_demographics7,200
customer_address6,000,000
income_band20
catalog_page30,000
item300,000
web_returns71,997,522
web_site54
promotion1,500
web_sales720,000,376
store1,002
web_page3,000
time_dim86,400
store_returns287,999,764
store_sales2,879,987,999
ship_mode20
customer12,000,000

4. 测试 SQL

TPC-DS 99 个测试查询语句: TPC-DS-Query-SQL

5. 测试结果

QueryDoris 2.1.11 (ms)Doris 3.1.4 (ms)Doris 4.0.5 (ms)Doris 4.1.0 (ms)
Total185200190159190031159562
query01420491541459
query02297030582510589
query03260311397150
query048000778272456046
query05310475786454
query06180245352313
query07310383347390
query08240381365408
query094670494747214158
query10200243328261
query114600515945553815
query1270156127121
query13410435471481
query14_16230635363375365
query14_25880627658765048
query15300291348265
query16390349275245
query176707458381139
query18410607636682
query19150210295247
query20120160141134
query215010011187
query221160936948802
query23_113670146271283810419
query23_213480141031263310303
query24_12360267727762774
query24_22320263424532616
query25400646671739
query26150212183184
query27300396390327
query284170466442603598
query29520640727721
query30190242236240
query311150124410701283
query32407711492
query33200310304268
query34370478478286
query35880893842813
query36340357337333
query3710016620481
query385200251165935704
query39_1200284299213
query39_2160220209157
query40100133162140
query41508611889
query42509011186
query43690708596326
query441330145513441010
query45300205204196
query46480570698443
query472770270926932123
query48260362362311
query49360511599490
query50490589797330
query516590690132664243
query52608712391
query53200272270276
query5487010831143244
query5550789684
query56150245293258
query571580155315921180
query58150226245246
query593960404734751648
query60200263318296
query61200294329299
query62590694758421
query63180226287232
query643220210126872679
query653270347233083101
query66350381359328
query6727490268382604022313
query68390421698270
query69180272742700
query702350216721172158
query71510847811754
query722160239332692215
query73290331391122
query743990411739183183
query753150345030993115
query76111011221224969
query77180233288219
query781045011343105919480
query791580192320081336
query80330411579463
query81320365406348
query82210259427154
query83140161176181
query8490120187145
query85300537770769
query86660652698726
query875280303968856258
query883670378641143209
query89330359410437
query90130149188128
query91100118204183
query9230547086
query93109011741247973
query94250240344166
query95260330374207
query96440475581345
query973630378527532738
query98240453410379
query99117014201612853

6. 环境准备

请先参照 官方文档 进行 Doris 的安装部署,以获得一个正常运行中的 Doris 集群(至少包含 1 FE 1 BE,推荐 1 FE 3 BE)。

7. 数据准备

7.1 下载安装 TPC-DS 数据生成工具

执行以下脚本下载并编译 tpcds-tools 工具。

sh bin/build-tpcds-tools.sh

7.2 生成 TPC-DS 测试集

执行以下脚本生成 TPC-DS 数据集:

sh bin/gen-tpcds-data.sh -s 1000

注 1:通过 sh gen-tpcds-data.sh -h 查看脚本帮助。

注 2:数据会以 .dat 为后缀生成在 tpcds-data/ 目录下。文件总大小约 1000GB。生成时间可能在数分钟到 1 小时不等。

注 3:默认生成 SF100 的标准测试数据集

7.3 建表

7.3.1 准备 doris-cluster.conf 文件

在调用导入脚本前,需要将 FE 的 ip 端口等信息写在 doris-cluster.conf 文件中。

文件位置在 ${DORIS_HOME}/tools/tpcds-tools/conf/ 目录下。

文件内容包括 FE 的 ip,HTTP 端口,用户名,密码以及待导入数据的 DB 名称:

# Any of FE host
export FE_HOST='127.0.0.1'
# http_port in fe.conf
export FE_HTTP_PORT=8030
# query_port in fe.conf
export FE_QUERY_PORT=9030
# Doris username
export USER='root'
# Doris password
export PASSWORD=''
# The database where TPC-DS tables located
export DB='tpcds'

7.3.2 执行以下脚本生成创建 TPC-DS 表

sh bin/create-tpcds-tables.sh -s 1000

或者复制 create-tpcds-tables.sql 中的建表语句,在 Doris 中执行。

7.4 导入数据

通过下面的命令执行数据导入:

sh bin/load-tpcds-data.sh

8 查询测试

8.1 执行查询脚本

单个 SQL 执行 或者 执行下面的命令

sh bin/run-tpcds-queries.sh -s 1000

8.2 单个 SQL 执行

你也可以从代码库里获取最新的 SQL。最新测试查询语句地址:TPC-DS 测试查询语句