benchmarksql测试mysql_BenchmarkSQL测试脚本实现-程序员宅基地

技术标签: benchmarksql测试mysql  

sqlTableCreates

DROP SCHEMA IF EXISTS benchmarksql CASCADE;

CREATE SCHEMA benchmarksql;

create table benchmarksql.warehouse (

w_id integer not null,

w_ytd decimal(12,2),

w_tax decimal(4,4),

w_name varchar(10),

w_street_1 varchar(20),

w_street_2 varchar(20),

w_city varchar(20),

w_state char(2),

w_zip char(9)

);

create table benchmarksql.district (

d_w_id integer not null,

d_id integer not null,

d_ytd decimal(12,2),

d_tax decimal(4,4),

d_next_o_id integer,

d_name varchar(10),

d_street_1 varchar(20),

d_street_2 varchar(20),

d_city varchar(20),

d_state char(2),

d_zip char(9)

);

create table benchmarksql.customer (

c_w_id integer not null,

c_d_id integer not null,

c_id integer not null,

c_discount decimal(4,4),

c_credit char(2),

c_last varchar(16),

c_first varchar(16),

c_credit_lim decimal(12,2),

c_balance decimal(12,2),

c_ytd_payment float,

c_payment_cnt integer,

c_delivery_cnt integer,

c_street_1 varchar(20),

c_street_2 varchar(20),

c_city varchar(20),

c_state char(2),

c_zip char(9),

c_phone char(16),

c_since timestamp,

c_middle char(2),

c_data varchar(500)

);

create sequence hist_id_seq;

create table benchmarksql.history (

hist_id integer not null default nextval('hist_id_seq') primary key,

h_c_id integer,

h_c_d_id integer,

h_c_w_id integer,

h_d_id integer,

h_w_id integer,

h_date timestamp,

h_amount decimal(6,2),

h_data varchar(24)

);

create table benchmarksql.oorder (

o_w_id integer not null,

o_d_id integer not null,

o_id integer not null,

o_c_id integer,

o_carrier_id integer,

o_ol_cnt decimal(2,0),

o_all_local decimal(1,0),

o_entry_d timestamp

);

create table benchmarksql.new_order (

no_w_id integer not null,

no_d_id integer not null,

no_o_id integer not null

);

create table benchmarksql.order_line (

ol_w_id integer not null,

ol_d_id integer not null,

ol_o_id integer not null,

ol_number integer not null,

ol_i_id integer not null,

ol_delivery_d timestamp,

ol_amount decimal(6,2),

ol_supply_w_id integer,

ol_quantity decimal(2,0),

ol_dist_info char(24)

);

create table benchmarksql.stock (

s_w_id integer not null,

s_i_id integer not null,

s_quantity decimal(4,0),

s_ytd decimal(8,2),

s_order_cnt integer,

s_remote_cnt integer,

s_data varchar(50),

s_dist_01 char(24),

s_dist_02 char(24),

s_dist_03 char(24),

s_dist_04 char(24),

s_dist_05 char(24),

s_dist_06 char(24),

s_dist_07 char(24),

s_dist_08 char(24),

s_dist_09 char(24),

s_dist_10 char(24)

);

create table benchmarksql.item (

i_id integer not null,

i_name varchar(24),

i_price decimal(5,2),

i_data varchar(50),

i_im_id integer

);

sqlTableDrops

drop table benchmarksql.warehouse;

drop table benchmarksql.item;

drop table benchmarksql.stock;

drop table benchmarksql.district;

drop table benchmarksql.customer;

drop table benchmarksql.oorder;

drop table benchmarksql.order_line;

drop table benchmarksql.history;

drop table benchmarksql.new_order;

sqlIndexCreates

alter table benchmarksql.warehouse add constraint pk_warehouse

primary key (w_id);

alter table benchmarksql.district add constraint pk_district

primary key (d_w_id, d_id);

alter table benchmarksql.customer add constraint pk_customer

primary key (c_w_id, c_d_id, c_id);

create index ndx_customer_name

on benchmarksql.customer (c_w_id, c_d_id, c_last, c_first);

select setval('hist_id_seq', (select max(hist_id) + 1 from benchmarksql.history), false);

alter table benchmarksql.oorder add constraint pk_oorder

primary key (o_w_id, o_d_id, o_id);

create unique index ndx_oorder_carrier

on benchmarksql.oorder (o_w_id, o_d_id, o_carrier_id, o_id);

alter table benchmarksql.new_order add constraint pk_new_order

primary key (no_w_id, no_d_id, no_o_id);

alter table benchmarksql.order_line add constraint pk_order_line

primary key (ol_w_id, ol_d_id, ol_o_id, ol_number);

alter table benchmarksql.stock add constraint pk_stock

primary key (s_w_id, s_i_id);

alter table benchmarksql.item add constraint pk_item

primary key (i_id);

vacuum analyze;

sqlIndexDrops

alter table benchmarksql.warehouse drop constraint pk_warehouse;

alter table benchmarksql.district drop constraint pk_district;

alter table benchmarksql.customer drop constraint pk_customer;

drop index ndx_customer_name;

-- history table has no primary key

-- commit;

alter table benchmarksql.oorder drop constraint pk_oorder;

drop index ndx_oorder_carrier;

alter table benchmarksql.new_order drop constraint pk_new_order;

alter table benchmarksql.order_line drop constraint pk_order_line;

alter table benchmarksql.stock drop constraint pk_stock;

alter table benchmarksql.item drop constraint pk_item;

sqlTableCopies

copy benchmarksql.warehouse

(w_id, w_ytd, w_tax, w_name, w_street_1, w_street_2, w_city, w_state, w_zip)

from '/tmp/csv/warehouse.csv' WITH CSV;

copy benchmarksql.item

(i_id, i_name, i_price, i_data, i_im_id)

from '/tmp/csv/item.csv' WITH CSV;

copy benchmarksql.stock

(s_i_id, s_w_id, s_quantity, s_ytd, s_order_cnt, s_remote_cnt, s_data,

s_dist_01, s_dist_02, s_dist_03, s_dist_04, s_dist_05,

s_dist_06, s_dist_07, s_dist_08, s_dist_09, s_dist_10)

from '/tmp/csv/stock.csv' WITH CSV;

copy benchmarksql.district

(d_id, d_w_id, d_ytd, d_tax, d_next_o_id, d_name, d_street_1,

d_street_2, d_city, d_state, d_zip)

from '/tmp/csv/district.csv' WITH CSV;

copy benchmarksql.customer

(c_id, c_d_id, c_w_id, c_discount, c_credit, c_last, c_first, c_credit_lim,

c_balance, c_ytd_payment, c_payment_cnt, c_delivery_cnt, c_street_1,

c_street_2, c_city, c_state, c_zip, c_phone, c_since, c_middle, c_data)

from '/tmp/csv/customer.csv' WITH CSV;

copy benchmarksql.history

(hist_id, h_c_id, h_c_d_id, h_c_w_id, h_d_id, h_w_id, h_date, h_amount, h_data)

from '/tmp/csv/cust-hist.csv' WITH CSV;

copy benchmarksql.oorder

(o_id, o_w_id, o_d_id, o_c_id, o_carrier_id, o_ol_cnt, o_all_local, o_entry_d)

from '/tmp/csv/order.csv' WITH CSV;

copy benchmarksql.order_line

(ol_w_id, ol_d_id, ol_o_id, ol_number, ol_i_id, ol_delivery_d,

ol_amount, ol_supply_w_id, ol_quantity, ol_dist_info)

from '/tmp/csv/order-line.csv' WITH CSV;

copy benchmarksql.new_order

(no_w_id, no_d_id, no_o_id)

from '/tmp/csv/new-order.csv' WITH CSV;

sqlTableTruncates

truncate table benchmarksql.warehouse;

truncate table benchmarksql.item;

truncate table benchmarksql.stock;

truncate table benchmarksql.district;

truncate table benchmarksql.customer;

truncate table benchmarksql.history;

truncate table benchmarksql.oorder;

truncate table benchmarksql.order_line;

truncate table benchmarksql.new_order;

clean.sh

rm -rf log/

mkdir -p log/archive

使用BenchmarkSQL测试PostgreSQL

BenchmarkSQL是一款经典的开源数据库测试工具,内嵌了TPCC测试脚本,可以对EnterpriseDB.PostgreSQL.MySQL.Oracle以及SQL Server等数据库直接进行测 ...

使用benchmarkSQL测试数据库的TPCC

压力测试是指在MySQL上线前,需要进行大量的压力测试,从而达到交付的标准.压力测试不仅可以测试MySQL服务的稳定性,还可以测试出MySQL和系统的瓶颈. TPCC测试:Transaction Pr ...

SPF邮件伪造漏洞测试脚本

测试脚本: # -*- coding: utf-8 -*- import socket,select,base64,os,re,time,datetime class mail: def __init ...

用BlazeMeter录制JMeter测试脚本

工具: 1,JMeter 2,Chrome 3,BlazeMeter 4,SwitchyOmega(如果需要代理) 步骤: 以上工具准备好以后就可以录制JMeter的测试脚本了, 在Chrome中点击 ...

Loadrunner开发测试脚本

Loadrunner开发测试脚本 开发测试脚本可以通过录制,也可以手动开发,建议能录制的尽量录制,省时省力,不能录制的只能费力自己开发了,具体看项目情况来决定. 使用Loadrunner开发脚本过程中 ...

菜鸟教程之工具使用(十)——用BlazeMeter录制JMeter测试脚本

工具: 1,JMeter 2,Chrome 3,BlazeMeter 4,SwitchyOmega(如果需要代理) 步骤: 以上工具准备好以后就可以录制JMeter的测试脚本了, 在Chrome中点击 ...

VS2010+Selenium测试脚本设计

VS2010+Selenium测试脚本设计 http://www.docin.com/p-755903506.html

更改QTP默认测试脚本路径

QTP的默认测试脚本路径为安装路径下的Tests文件夹下, 如果你安装在D:,那么默认脚本路径为D:\Program Files\HP\QuickTest Professional\Tests 但是因 ...

微信聊天测试脚本 wx_sample.php

<?php                             );         curl_setopt($ch, CURLO ...

随机推荐

基于Redis的爬虫平台的实现

一.需求: 1.数据抓取:目标数据的下载.解析.入库功能. 2.数据服务:黑名单.灰名单等查询服务. 3.平台监控:平台各个模块的数据实时监控. 二.WEB端效果展示: 三.架构设计 下载器.解析器. ...

通过Spark SQL关联查询两个HDFS上的文件操作

order_created.txt   订单编号  订单创建时间 -- :: -- :: -- :: -- :: -- :: order_picked.txt   订单编号  订单提取时间 -- :: ...

&lbrack;翻译]java nio 概述

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_33971453/article/details/113376112

智能推荐

ASP.Net中使用Log4Net-程序员宅基地

文章浏览阅读254次。1、在Web.Config配置Code<configSections><sectionname="log4net"type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/></configSections><log4net><!--De..._asp.net中使用log4net

js实现图片压缩【无需导包】-程序员宅基地

文章浏览阅读800次。将图片压缩后,我们会得到一个 Base64 编码的字符串,该字符串包括了压缩后的图片数据以及一些元信息,如图片格式、压缩质量等。可以通过第二个参数来设置图片的压缩质量,该参数的取值范围是0到1,其中0表示最低质量(最高压缩),1表示最高质量(最低压缩,默认值为0.92)。就是如果后续需要把压缩后的图片比如说进行上传操作,我们得得到处理后图片的Base64 编码就好办了,其实这个 Base64 编码就在眼前。这里我再提供一个vue测试代码,可以在控制台中打印出图片压缩前后的size,以及图片压缩后的回显。

第十三届蓝桥杯省赛C++ C组《全题目+题解》_蓝桥杯c组省赛-程序员宅基地

文章浏览阅读5.4k次,点赞75次,收藏141次。本篇来自第十三届蓝桥杯省赛C++ C组《全题目+题解》_蓝桥杯c组省赛

MATLAB车道线检测技术分析_车道路线识别matlab-程序员宅基地

文章浏览阅读942次,点赞22次,收藏21次。车道线检测的应用场景具有时序信息特性,为了利用时序特征通常会引入RNN模块,加上Encoder-Decoder的形式已经成为CNN特征提取的标配,所以一般的做法是对Encoder提取的Features进行进一步加工,提取连续帧带来的历史信息。VPGNet:一共20k张图片,包含白天(非雨天、雨天、大雨天)、夜晚的数据,同时包含了各种车道线类型,以及其他不同类型的车道标识(左转箭头、直行箭头、斑马线等等),如下图。TuSimple:一共72k张图片,位于高速路,天气晴朗,车道线清晰,特点是车道线以点来标注;_车道路线识别matlab

kds官方android客户端,电子厨打设置(KDS/ADS)-程序员宅基地

文章浏览阅读1.3k次。KDS应用场景KDS和ADS设置使用方案:厨房模式(KDS) 配菜模式(ADS) 呼叫广告模式(TV)电子菜牌模式KDS(kitchen display system)ADS(assign display system)准备工作安卓电子厨打客户端硬件要求:各类安卓平板及安卓一体机(安卓4.4.2以上,7寸屏以上)收银设备的IP,做KDS的设备IP,做ADS的设备IP必须在同一个网段(接同一个路由上..._kitchen display system

Nginx + Consul + Upsync实现动态负载均衡_consul+nginx-upsync-module-程序员宅基地

文章浏览阅读1.7k次。各组件作用:ConsulWeb:Consul的客户端可视化界面,管理负载均衡配置的信息ConsulServer:Consul服务端,用于存放负载均衡配置Nginx:以间隔时间动态读取ConsulServer配置Upsync:新浪微博开源的基于Nginx实现动态配置的三方模块。Nginx-Upsync-Module的功能是拉取Consul的后端server的列表,并动态更新Nginx..._consul+nginx-upsync-module

随便推点

C#中关于XML与对象,集合的相互转换-程序员宅基地

文章浏览阅读404次。XML与对象,集合的相互转化  今天小伙伴在群里问了一下关于XML与对象之间的相互转换,作为菜鸟的我正好趁着闲着的时间学习了一波,直接上代码了,有疑问或者有错误的地方还请大家指正,谢谢。。。。 1 using System; 2 using System.Collections.Generic; 3 using System.IO; 4 using System...._c# xml转集合

笔记:图以及cpp基础-程序员宅基地

文章浏览阅读1.8k次。如int fun(int i,char a)和void fun(char a,int i)就可以构成函数重载,根据函数名修饰的原理我们可以得到_funic和 _funci两个经过修饰之后得到的函数名,在进行修饰后的函数名显然是不同的。定义:同一个作用域内,相同函数名,参数不同(类型不同,个数不同)可以构成函数重载(和返回值无关)分析其二:顶点i的度即为第i行和i列的“1”的个数,如果是无向图就只要考虑每一行“1”的个数。图的邻接矩阵为一个二维数组,设为A.arcs【i】【j】(理解为两个顶点之间的关系)_cpp

CISCO路由器交换机简介及Packet+Tracer使用说明-程序员宅基地

文章浏览阅读571次。附录一 路由器和交换机产品简介 (一)路由器 思科公司的产品被网络用户广泛的使用,对它们的典型产品及其特性的了解可对网络设备有一定大致的认识,以下主要对Cisco1800系列、Cisco2600系列、Cisco 2800系列、Cisco 3700 系列模块化和固定配置的路由器产品进行简单介绍。首先以"S26C-12007XK ","CD26-BHP-12..._cisco packet tracer路由器与转发器

XHTML_xhtml 中正确标记折行-程序员宅基地

文章浏览阅读2.2k次。XHTML 是以 XML 格式编写的 HTML。什么是 XHTML? XHTML 指的是可扩展超文本标记语言 XHTML 与 HTML 4.01 几乎是相同的 XHTML 是更严格更纯净的 HTML 版本 XHTML 是以 XML 应用的方式定义的 HTML XHTML 是 2001 年 1 月发布的 W3C 推荐标准 XHTML 得到所有主流浏览器的..._xhtml 中正确标记折行

计算机图形图像处理在教学中的应用,计算机图形图像处理案例教学法运用-程序员宅基地

文章浏览阅读534次。摘要:笔者根据计算机图形图像处理课程与中职学生学习的特点,分析了目前中职学校计算图形图像处理课程教学中存在的问题,针对如何提高中职学生对计算机图形图像处理课程的学习兴趣和解决实际问题的能力,提出了案例教学法在该课程中的具体实施办法,并对其实践进行了进一步的讨论。关键词:计算机图形图像处理;案例教学;中职当今世界电子商务发展迅速,计算机平面设计这门技术在很多领域都得到广泛应用。《Photoshop图..._图像分类在教育中的应用

python资源文件嵌入exe_pyinstaller将资源文件打包进exe中-程序员宅基地

文章浏览阅读921次。在网上看了很多博客,终于找到了符合自己智商可理解的打包资源文件方法,现引用如下https://www.cnblogs.com/darcymei/p/9397173.htmlhttps://blog.csdn.net/sinat_27382047/article/details/81304065"""终于把资源文件加载进去了,就是当exe文件移植后,它运行的时候会产生一个临时文件夹,把资源文件存储到..._pyinstaller如何将_internal添加进exe

推荐文章

热门文章

相关标签