Commit 809c4c6c authored by casualet's avatar casualet

modify tpcc

parent 407873b2
drop table if exists warehouse; drop table if exists warehouse;
SET sql_mode = '';
create table warehouse ( create table warehouse (
w_id smallint not null, w_id smallint unsigned,
w_name varchar(10), w_name varchar(10),
w_street_1 varchar(20), w_street_1 varchar(20),
w_street_2 varchar(20), w_street_2 varchar(20),
w_city varchar(20), w_city varchar(20),
w_state char(2), w_state char(2),
w_zip char(9), w_zip char(9),
w_tax decimal(4,2), w_tax integer unsigned,
w_ytd decimal(12,2) w_ytd integer unsigned
) Engine=InnoDB; ) Engine=InnoDB;
drop table if exists district; drop table if exists district;
create table district ( create table district (
d_id tinyint not null, d_id tinyint unsigned,
d_w_id smallint not null, d_w_id smallint unsigned,
d_name varchar(10), d_name varchar(10),
d_street_1 varchar(20), d_street_1 varchar(20),
d_street_2 varchar(20), d_street_2 varchar(20),
d_city varchar(20), d_city varchar(20),
d_state char(2), d_state char(2),
d_zip char(9), d_zip char(9),
d_tax decimal(4,2), d_tax integer unsigned,
d_ytd decimal(12,2), d_ytd integer unsigned,
d_next_o_id int d_next_o_id int unsigned
) Engine=InnoDB; ) Engine=InnoDB;
drop table if exists customer; drop table if exists customer;
create table customer ( create table customer (
c_id int not null, c_id int unsigned,
c_d_id tinyint not null, c_d_id tinyint unsigned,
c_w_id smallint not null, c_w_id smallint unsigned,
c_first varchar(16), c_first varchar(16),
c_middle char(2), c_middle char(2),
c_last varchar(16), c_last varchar(16),
...@@ -43,12 +44,12 @@ c_city varchar(20), ...@@ -43,12 +44,12 @@ c_city varchar(20),
c_state char(2), c_state char(2),
c_zip char(9), c_zip char(9),
c_phone char(16), c_phone char(16),
c_since datetime, c_since varchar(20),
c_credit char(2), c_credit char(2),
c_credit_lim bigint, c_credit_lim bigint unsigned,
c_discount decimal(4,2), c_discount bigint unsigned,
c_balance decimal(12,2), c_balance bigint unsigned,
c_ytd_payment decimal(12,2), c_ytd_payment bigint unsigned,
c_payment_cnt smallint, c_payment_cnt smallint,
c_delivery_cnt smallint, c_delivery_cnt smallint,
c_data VARCHAR(1000)) Engine=InnoDB; c_data VARCHAR(1000)) Engine=InnoDB;
...@@ -61,8 +62,8 @@ h_c_d_id tinyint, ...@@ -61,8 +62,8 @@ h_c_d_id tinyint,
h_c_w_id smallint, h_c_w_id smallint,
h_d_id tinyint, h_d_id tinyint,
h_w_id smallint, h_w_id smallint,
h_date datetime, h_date varchar(20),
h_amount decimal(6,2), h_amount integer unsigned,
h_data varchar(24) ) Engine=InnoDB; h_data varchar(24) ) Engine=InnoDB;
drop table if exists new_orders; drop table if exists new_orders;
...@@ -79,7 +80,7 @@ o_id int not null, ...@@ -79,7 +80,7 @@ o_id int not null,
o_d_id tinyint not null, o_d_id tinyint not null,
o_w_id smallint not null, o_w_id smallint not null,
o_c_id int, o_c_id int,
o_entry_d datetime, o_entry_d varchar(20),
o_carrier_id tinyint, o_carrier_id tinyint,
o_ol_cnt tinyint, o_ol_cnt tinyint,
o_all_local tinyint) Engine=InnoDB ; o_all_local tinyint) Engine=InnoDB ;
...@@ -93,9 +94,9 @@ ol_w_id smallint not null, ...@@ -93,9 +94,9 @@ ol_w_id smallint not null,
ol_number tinyint not null, ol_number tinyint not null,
ol_i_id int, ol_i_id int,
ol_supply_w_id smallint, ol_supply_w_id smallint,
ol_delivery_d datetime, ol_delivery_d varchar(20),
ol_quantity tinyint, ol_quantity tinyint,
ol_amount decimal(6,2), ol_amount integer unsigned,
ol_dist_info char(24)) Engine=InnoDB ; ol_dist_info char(24)) Engine=InnoDB ;
drop table if exists item; drop table if exists item;
...@@ -104,7 +105,7 @@ create table item ( ...@@ -104,7 +105,7 @@ create table item (
i_id int not null, i_id int not null,
i_im_id int, i_im_id int,
i_name varchar(24), i_name varchar(24),
i_price decimal(5,2), i_price integer unsigned,
i_data varchar(50) i_data varchar(50)
) Engine=InnoDB; ) Engine=InnoDB;
...@@ -124,8 +125,8 @@ s_dist_07 char(24), ...@@ -124,8 +125,8 @@ s_dist_07 char(24),
s_dist_08 char(24), s_dist_08 char(24),
s_dist_09 char(24), s_dist_09 char(24),
s_dist_10 char(24), s_dist_10 char(24),
s_ytd decimal(8,0), s_ytd integer unsigned,
s_order_cnt smallint, s_order_cnt smallint,
s_remote_cnt smallint, s_remote_cnt smallint,
s_data varchar(50)) Engine=InnoDB ; s_data varchar(50)) Engine=InnoDB;
...@@ -7,6 +7,6 @@ mysql -uroot -pletmein -h127.0.0.1 tpcc1000 < create_table.sql ...@@ -7,6 +7,6 @@ mysql -uroot -pletmein -h127.0.0.1 tpcc1000 < create_table.sql
./tpcc_load -h127.0.0.1 -uroot -pletmein -d tpcc1000 -w $1 ./tpcc_load -h127.0.0.1 -uroot -pletmein -d tpcc1000 -w $1
# mysqldump --skip-extended-insert -uroot -pletmein -h127.0.0.1 --no-create-info --hex-blob --compact tpcc1000 > all$1.sql # mysqldump --skip-extended-insert -uroot -pletmein -h127.0.0.1 --no-create-info --hex-blob --compact tpcc1000 > all$1.sql
mysqldump --skip-extended-insert -uroot -pletmein -h127.0.0.1 --hex-blob --compact tpcc1000 > all$1.sql mysqldump -uroot -pletmein -h127.0.0.1 --hex-blob --compact tpcc1000 --compact > all$1.sql
mysql -uroot -pletmein -h127.0.0.1 -e "drop database if exists tpcc1000" mysql -uroot -pletmein -h127.0.0.1 -e "drop database if exists tpcc1000"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment