AntDB OLAP测试之–TPC-DS基准测试
一、下载安装TPC-DS工具
下载TPC-DS源码:
http://www.tpc.org/tpc_documents_current_versions/current_specifications.asp
选择合适的版本,本次选择:tpc-ds-tool-v2.1.0.zip
编译安装:
make前需要检测依赖:gcc gcc-c++ libstdc+±devel bison byacc flex
如果没有安装的话,yum install
[adb3.1@intel176 ~]$ unzip tpc-ds-tool-v2.1.0.zip
[adb3.1@intel176 ~]$ cd tpc-ds-tool-v2.1.0/tools/
[adb3.1@intel176 tools]$ make
[adb3.1@intel176 tools]$ ll | grep dsd
-rwxrwxr-x 1 adb3.1 adb3.1 455504 Mar 4 14:59 dsdgen
以上TPC-DS测试工具就准备好了。
二、元数据导入到AntDB中
1、元数据:
tpcds.sql 创建25张表的sql语句
tpcds_ri.sql 创建表与表之间关系的sql语句
[adb3.1@intel176 tools]$ ll | grep tpcds
-rw-rw-r-- 1 adb3.1 adb3.1 1722 Nov 11 2015 tpcds_20080910.sum
-rw-rw-r-- 1 adb3.1 adb3.1 20097 Nov 11 2015 tpcds.dst
-rw-rw-r-- 1 adb3.1 adb3.1 640583 Mar 4 14:59 tpcds.idx
-rw-rw-r-- 1 adb3.1 adb3.1 7125 Mar 4 14:59 tpcds.idx.h
-rw-rw-r-- 1 adb3.1 adb3.1 13869 Nov 11 2015 tpcds_ri.sql
-rw-rw-r-- 1 adb3.1 adb3.1 22153 Nov 11 2015 tpcds_source.sql
-rw-rw-r-- 1 adb3.1 adb3.1 30001 Nov 11 2015 tpcds.sql
-rw-rw-r-- 1 adb3.1 adb3.1 233068 Nov 11 2015 tpcds.wam
2、元数据导入AntDB中:
[adb3.1@intel176 tools]$ coord1
psql (4.0.0 7beda81237 based on PG 10.7)
Type "help" for help.
postgres=# create database tpcds;
CREATE DATABASE
postgres=# \c tpcds
You are now connected to database "tpcds" as user "adb3.1".
tpcds=# \i ~/tpc-ds-tool-v2.1.0/tools/tpcds.sql
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
三、生成数据并将数据导入AntDB
1、生成数据
-scale 1代表1G数据
-parallel 10使用10个线程
[adb3.1@intel176 tools]$ ./dsdgen -h
DBGEN2 Population Generator (Version 2.0.0)
Copyright Transaction Processing Performance Council (TPC) 2001 - 2015
USAGE: DBGEN2 [options]
Note: When defined in a parameter file (using -p), parmeters should
use the form below. Each option can also be set from the command
line, using a form of '-param [optional argument]'
Unique anchored substrings of options are also recognized, and
case is ignored, so '-sc' is equivalent to '-SCALE'
General Options
===============
ABREVIATION = <s> -- build table with abreviation <s>
DIR = <s> -- generate tables in directory <s>
HELP = <n> -- display this message
PARAMS = <s> -- read parameters from file <s>
QUIET = [Y|N] -- disable all output to stdout/stderr
SCALE = <n> -- volume of data to generate in GB
TABLE = <s> -- build only table <s>
UPDATE = <n> -- generate update data set <n>
VERBOSE = [Y|N] -- enable verbose output
PARALLEL = <n> -- build data in <n> separate chunks
CHILD = <n> -- generate <n>th chunk of the parallelized data
RELEASE = [Y|N] -- display the release information
_FILTER = [Y|N] -- output data to stdout
VALIDATE