1

如何为 SQL Server填充事务处理性能委员会的TPC-DS数据库?我已经下载了TPC-DS 工具,但是关于如何使用它的教程很少。

4

3 回答 3

1

如果您使用的是 Windows,则必须具有 Visual Studio 2005 或更高版本。在文件夹 tools 中解压 dsgen 有 dsgen2.sln 文件,使用 Visual Studio 打开它并构建项目,将为您生成表,我已经尝试过,我将表手动加载到 sql server

于 2013-03-10T10:44:37.113 回答
0

我刚刚成功生成了这些查询。有一些技巧可能不是最好的但很有用。

  1. cp ${...}/query_templates/* ${...}/tools/
  2. 添加define _END = "";到每个 query.tpl
  3. ${...}/tools/dsqgen -INPUT templates.lst -OUTPUT_DIR /home/query99/
于 2015-07-27T14:44:32.723 回答
0

让我们描述一下基本步骤:

  1. 在进行下一步之前,请仔细检查所需的 TPC-DS 套件是否尚未为您的数据库准备好

  2. 下载TPC-DS 工具

  3. 'v2.11.0rc2\tools\How_To_Guide-DS-V2.0.0.docx' 中描述的构建工具(我使用VS2015

  4. 创建数据库

采用tpcds.sqltpcds_ri.sql中描述的数据库模式(它们位于'v2.11.0rc2\tools\' -文件夹中),如果需要,将其适合您的数据库。

  1. 生成存储到数据库的数据
# Windows
dsdgen.exe /scale 1 /dir .\tmp /suffix _001.dat

# Linux
dsdgen -scale 1 -dir /tmp -suffix _001.dat
  1. 上传数据到数据库
# example for ClickHouse

database_name=tpcds
ch_password=12345

for file_fullpath in /tmp/tpc-ds/*.dat; do
  filename=$(echo ${file_fullpath##*/})
  tablename=$(echo ${filename%_*})
  echo " - $(date +"%T"): start processing $file_fullpath (table: $tablename)"

  query="INSERT INTO $database_name.$tablename FORMAT CSV"
  cat $file_fullpath | clickhouse-client --format_csv_delimiter="|" --query="$query" --password $ch_password
done
  1. 生成查询
# Windows
set tmpl_lst_path="..\query_templates\templates.lst"
set tmpl_dir="..\query_templates"
set dialect_path="..\..\clickhouse-dialect"
set result_dir="..\queries"
set tmpl_name="query1.tpl"

dsqgen /input %tmpl_lst_path% /directory %tmpl_dir% /dialect %dialect_path% /output_dir %result_dir% /scale 1 /verbose y /template %tmpl_name%

# Linux
# see for example https://github.com/pingcap/tidb-bench/blob/master/tpcds/genquery.sh

要修复错误“在初始化之前使用替换 ..”,请遵循此修复

于 2020-03-10T21:23:46.957 回答