Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port for Firebird #1

Open
wants to merge 3 commits into
base: my-version
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions HOW-TO-RUN.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ Use of JDK7 is required. Sample JDBC Connection Property files are provided as
props.pg : for PostgreSQL/EnterpriseDB
props.ora : for Oracle
props.db2 : for DB2
props.fb : for Firebird

0. As the user postgres, create the benchmarksql user with correct permissions.
0. (skip for Firebird) As the user postgres, create the benchmarksql user with correct permissions.
postgres=# CREATE USER benchmarksql WITH SUPERUSER PASSWORD 'password';
postgres=# GRANT ALL PRIVILEGES ON DATABASE postgres TO benchmarksql;

Expand All @@ -15,7 +16,7 @@ Use of JDK7 is required. Sample JDBC Connection Property files are provided as

2. Run the "sqlTableCreates" to create the base tables.

$ ./runSQL.sh props.pg sqlTableCreates
$ ./runSQL.sh props.?? sqlTableCreates.??


3. Run the Loader command file to load all of the default data
Expand All @@ -25,7 +26,7 @@ Use of JDK7 is required. Sample JDBC Connection Property files are provided as
A.) Approximately half a million rows (per Warehouse) will be loaded
across 9 tables.

$ ./runLoader.sh props.pg numWarehouses 1
$ ./runLoader.sh props.?? numWarehouses 1

NOTE: You should run the sqlTableTruncates scripts if your tables
are not already empty.
Expand All @@ -35,25 +36,25 @@ Use of JDK7 is required. Sample JDBC Connection Property files are provided as
bulk loaded into the database as many times as required by your
testing.

$ ./runLoader.sh props.pg numWarehouses 1 fileLocation /tmp/csv/
$ ./runLoader.sh props.?? numWarehouses 1 fileLocation /tmp/csv/

These CSV files can be bulk loaded as follows:
$ ./runSQL.sh props.pg sqlTableCopies

You may truncate the data via:

$ ./runSQL.sh props.pg sqlTableTruncates
$ ./runSQL.sh props.?? sqlTableTruncates.??

4. Run the "runSQL" command file to execute the SQL script
"sqlIndexCreates" to create the primary keys & other indexes
on the tables.

$ ./runSQL.sh props.pg sqlIndexCreates
$ ./runSQL.sh props.?? sqlIndexCreates.??


5. Run the "runBenchmark" command file to test the database. This command
will create terminals and automatically start the transaction based on
the parameters set in "props".

$ ./runBenchmark.sh props.pg
$ ./runBenchmark.sh props.??

2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<project name="BenchmarkSQL" default="dist" basedir=".">
<description>BenchmarkSQL Build File</description>

<presetdef name="javac"> <javac includeantruntime="false" /> </presetdef>
<presetdef name="javac"> <javac includeantruntime="false" debug="off" /> </presetdef>

<property name="src" location="src"/>
<property name="build" location="build"/>
Expand Down
Binary file modified build/Customer.class
100755 → 100644
Binary file not shown.
Binary file modified build/District.class
100755 → 100644
Binary file not shown.
Binary file modified build/ExecJDBC.class
100755 → 100644
Binary file not shown.
Binary file modified build/History.class
100755 → 100644
Binary file not shown.
Binary file modified build/Item.class
100755 → 100644
Binary file not shown.
Binary file modified build/LoadData.class
100755 → 100644
Binary file not shown.
Binary file modified build/NewOrder.class
100755 → 100644
Binary file not shown.
Binary file modified build/Oorder.class
100755 → 100644
Binary file not shown.
Binary file modified build/OrderLine.class
100755 → 100644
Binary file not shown.
Binary file modified build/Stock.class
100755 → 100644
Binary file not shown.
Binary file modified build/Warehouse.class
100755 → 100644
Binary file not shown.
Binary file modified build/jTPCC.class
100755 → 100644
Binary file not shown.
Binary file modified build/jTPCCConfig.class
100755 → 100644
Binary file not shown.
Binary file modified build/jTPCCTerminal.class
100755 → 100644
Binary file not shown.
Binary file modified build/jTPCCUtil.class
100755 → 100644
Binary file not shown.
Binary file modified build/jdbcIO.class
100755 → 100644
Binary file not shown.
Binary file modified dist/BenchmarkSQL-4.1.jar
100755 → 100644
Binary file not shown.
Binary file added lib/connector-api-1.5.jar
Binary file not shown.
Binary file added lib/jaybird-jdk18-3.0.15.jar
Binary file not shown.
Empty file modified lib/postgresql-9.3-1101.jdbc41.jar
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions run/props.db2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ driver=com.ibm.db2.jcc.DB2Driver
conn=jdbc:db2://localhost:50000/bmarkdb
user=db2inst1
password=db2admin
schema=benchmark.


warehouses=1
Expand Down
24 changes: 24 additions & 0 deletions run/props.fb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
driver=org.firebirdsql.jdbc.FBDriver
conn=jdbc:firebirdsql:localhost:/mnt/ssd/jtpcc.fdb
user=sysdba
password=masterkey
schema=

warehouses=10
terminals=10
//To run specified transactions per terminal- runMins must equal zero
runTxnsPerTerminal=0
//To run for specified minutes- runTxnsPerTerminal must equal zero
runMins=10
//Number of total transactions per minute
limitTxnsPerMin=0


//The following five values must add up to 100
//The default percentages of 45, 43, 4, 4 & 4 match the TPC-C spec
newOrderWeight=45
paymentWeight=43
orderStatusWeight=4
deliveryWeight=4
stockLevelWeight=4

2 changes: 1 addition & 1 deletion run/props.ora
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ driver=oracle.jdbc.driver.OracleDriver
conn=jdbc:oracle:thin:@localhost:1521:XE
user=scott
password=tiger

schema=benchmark.

warehouses=1
terminals=1
Expand Down
1 change: 1 addition & 0 deletions run/props.pg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ driver=org.postgresql.Driver
conn=jdbc:postgresql://localhost:5432/postgres
user=benchmarksql
password=password
schema=benchmark.

warehouses=1
terminals=1
Expand Down
3 changes: 2 additions & 1 deletion run/runBenchmark.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
java -cp .:../lib/postgresql-9.3-1101.jdbc41.jar:../lib/log4j-1.2.17.jar:../lib/apache-log4j-extras-1.1.jar:../dist/BenchmarkSQL-4.1.jar -Dprop=$1 jTPCC
#java -cp .:../lib/postgresql-9.3-1101.jdbc41.jar:../lib/log4j-1.2.17.jar:../lib/apache-log4j-extras-1.1.jar:../dist/BenchmarkSQL-4.1.jar -Dprop=$1 jTPCC
java -cp .:../lib/connector-api-1.5.jar:../lib/jaybird-jdk18-3.0.15.jar:../lib/log4j-1.2.17.jar:../lib/apache-log4j-extras-1.1.jar:../dist/BenchmarkSQL-4.1.jar -Dprop=$1 jTPCC
3 changes: 2 additions & 1 deletion run/runLoader.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
java -cp .:../lib/postgresql-9.3-1101.jdbc41.jar:../dist/BenchmarkSQL-4.1.jar -Dprop=$1 LoadData $2 $3 $4 $5
#java -cp .:../lib/postgresql-9.3-1101.jdbc41.jar:../dist/BenchmarkSQL-4.1.jar -Dprop=$1 LoadData $2 $3 $4 $5
java -cp .:../lib/connector-api-1.5.jar:../lib/jaybird-jdk18-3.0.15.jar:../dist/BenchmarkSQL-4.1.jar -Dprop=$1 LoadData $2 $3 $4 $5
3 changes: 2 additions & 1 deletion run/runSQL.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
myCP="../lib/postgresql-9.3-1101.jdbc41.jar"
#myCP="../lib/postgresql-9.3-1101.jdbc41.jar"
myCP="../lib/connector-api-1.5.jar:../lib/jaybird-jdk18-3.0.15.jar"
myCP="$myCP:../dist/BenchmarkSQL-4.1.jar"

myOPTS="-Dprop=$1"
Expand Down
30 changes: 30 additions & 0 deletions run/sqlIndexCreates.fb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

alter table warehouse add constraint pk_warehouse
primary key (w_id);

alter table district add constraint pk_district
primary key (d_w_id, d_id);

alter table customer add constraint pk_customer
primary key (c_w_id, c_d_id, c_id);

create index ndx_customer_name
on customer (c_w_id, c_d_id, c_last, c_first);

alter table oorder add constraint pk_oorder
primary key (o_w_id, o_d_id, o_id);

create unique index ndx_oorder_carrier
on oorder (o_w_id, o_d_id, o_carrier_id, o_id);

alter table new_order add constraint pk_new_order
primary key (no_w_id, no_d_id, no_o_id);

alter table order_line add constraint pk_order_line
primary key (ol_w_id, ol_d_id, ol_o_id, ol_number);

alter table stock add constraint pk_stock
primary key (s_w_id, s_i_id);

alter table item add constraint pk_item
primary key (i_id);
21 changes: 21 additions & 0 deletions run/sqlIndexDrops.fb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

alter table warehouse drop constraint pk_warehouse;

alter table district drop constraint pk_district;

alter table customer drop constraint pk_customer;
drop index ndx_customer_name;

-- history table has no primary key
-- commit;

alter table oorder drop constraint pk_oorder;
drop index ndx_oorder_carrier;

alter table new_order drop constraint pk_new_order;

alter table order_line drop constraint pk_order_line;

alter table stock drop constraint pk_stock;

alter table item drop constraint pk_item;
124 changes: 124 additions & 0 deletions run/sqlTableCreates.fb
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
create table 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 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 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 table history (
hist_id integer generated by default as identity 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 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 new_order (
no_w_id integer not null,
no_d_id integer not null,
no_o_id integer not null
);


create table 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 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 item (
i_id integer not null,
i_name varchar(24),
i_price decimal(5,2),
i_data varchar(50),
i_im_id integer
);

2 changes: 0 additions & 2 deletions run/sqlTableDrops
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ drop table benchmarksql.order_line;
drop table benchmarksql.history;

drop table benchmarksql.new_order;

DROP SCHEMA IF EXISTS benchmarksql CASCADE;
20 changes: 20 additions & 0 deletions run/sqlTableDrops.fb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

drop table warehouse;

drop table item;

drop table stock;

drop table district;

drop table customer;

drop table oorder;

drop table order_line;

drop table history;

drop sequence hist_id_seq;

drop table new_order;
18 changes: 18 additions & 0 deletions run/sqlTableTruncates.fb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

delete from warehouse;

delete from item;

delete from stock;

delete from district;

delete from customer;

delete from history;

delete from oorder;

delete from order_line;

delete from new_order;
Loading