From 1e72f5a34fdee4c42067cad58bdbc9132e8fefb0 Mon Sep 17 00:00:00 2001 From: robert-s-lee Date: Sun, 4 Jun 2023 14:52:53 -0400 Subject: [PATCH 1/6] cache oracle client install --- pom-arcion.xml | 412 +++++++++++++++++++++++++++++++++++++++++++++++++ pom.xml | 89 +++++++++++ 2 files changed, 501 insertions(+) create mode 100644 pom-arcion.xml diff --git a/pom-arcion.xml b/pom-arcion.xml new file mode 100644 index 000000000..34d1bcf2a --- /dev/null +++ b/pom-arcion.xml @@ -0,0 +1,412 @@ + + + 4.0.0 + + + com.oltpbenchmark + benchbase + 2021-SNAPSHOT + BenchBase + BenchBase is a Multi-DBMS SQL Benchmarking Framework via JDBC https://github.com/cmu-db/benchbase + https://github.com/cmu-db/benchbase + + + UTF-8 + 17 + 17 + 17 + ${project.basedir}/target + + + + scm:git:git@github.com:cmu-db/benchbase.git + https://github.com/cmu-db/benchbase + scm:git:git@github.com:cmu-db/benchbase.git + HEAD + + + + + github + GitHub cmu-db/benchbase Apache Maven Packages + https://maven.pkg.github.com/cmu-db/benchbase + + + + + + sqlite + + sqlite + + + + org.xerial + sqlite-jdbc + 3.36.0.3 + + + + + db2 + + db2 + + + + com.ibm.db2 + jcc + 11.5.8.0 + + + + + postgres + + postgres + + + + org.postgresql + postgresql + 42.4.0 + + + + + snowflake + + snowflake + + + + + net.snowflake + snowflake-jdbc + 3.13.30 + + + + + mysql + + mysql + + + + mysql + mysql-connector-java + 8.0.29 + + + + + mariadb + + mariadb + + + + org.mariadb.jdbc + mariadb-java-client + 2.7.8 + + + + + spanner + + spanner + + + + com.google.cloud + google-cloud-spanner-jdbc + 2.6.1 + + + + + cockroachdb + + cockroachdb + + + + org.postgresql + postgresql + 42.4.0 + + + + + oracle + + oracle + + + + com.oracle.database.jdbc + ojdbc8 + 21.1.0.0 + + + + + phoenix + + phoenix + + + + org.apache.phoenix + phoenix-client-hbase-2.4 + 5.1.3 + + + + + sqlserver + + sqlserver + + + + com.microsoft.sqlserver + mssql-jdbc + 11.2.3.jre17 + + + + + informix + + informix + + + + + com.ibm.informix + jdbc + 4.50.3 + + + + org.mongodb + bson + 3.8.0 + + + + + + + + org.slf4j + slf4j-api + 1.7.36 + + + + org.slf4j + slf4j-reload4j + 1.7.36 + + + + org.apache.commons + commons-configuration2 + 2.8.0 + + + + commons-jxpath + commons-jxpath + 1.3 + + + + org.apache.commons + commons-lang3 + 3.12.0 + + + + commons-cli + commons-cli + 1.5.0 + + + + commons-io + commons-io + 2.11.0 + + + + org.apache.commons + commons-collections4 + 4.4 + + + + com.opencsv + opencsv + 5.7.1 + + + + org.json + json + 20220320 + + + + jakarta.xml.bind + jakarta.xml.bind-api + 4.0.0 + + + + org.glassfish.jaxb + jaxb-runtime + 4.0.0 + + + + org.hsqldb + hsqldb + 2.6.1 + + + + junit + junit + 4.13.2 + test + + + + + + + ${buildDirectory} + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + ${maven.compiler.source} + ${maven.compiler.target} + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.2 + + ${classifier} + + + true + true + true + lib + com.oltpbenchmark.DBWorkload + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.4.1 + + + package + + single + + + false + ${project.artifactId}-${classifier} + + src/main/assembly/tgz.xml + src/main/assembly/zip.xml + + + + + + + maven-clean-plugin + 3.2.0 + + + + results + + *.* + + false + + + + + + maven-release-plugin + 2.5.3 + + false + v@{version} + + + + pl.project13.maven + git-commit-id-plugin + 4.9.10 + + + get-the-git-infos + + revision + + initialize + + + + true + ${project.build.outputDirectory}/git.properties + full + true + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.3.0 + + + analyze + + analyze-only + + + false + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + com.oltpbenchmark.DBWorkload + + + + + + diff --git a/pom.xml b/pom.xml index 60323dd1a..33ef84536 100644 --- a/pom.xml +++ b/pom.xml @@ -49,6 +49,68 @@ + + arcion + + arcion + + + + org.xerial + sqlite-jdbc + 3.36.0.3 + + + com.ibm.db2 + jcc + 11.5.8.0 + + + org.postgresql + postgresql + 42.4.0 + + + + net.snowflake + snowflake-jdbc + 3.13.30 + + + mysql + mysql-connector-java + 8.0.29 + + + org.mariadb.jdbc + mariadb-java-client + 2.7.8 + + + com.oracle.database.jdbc + ojdbc8 + 21.1.0.0 + + + com.microsoft.sqlserver + mssql-jdbc + 11.2.3.jre17 + + + + com.ibm.informix + jdbc + 4.50.3 + + + + org.mongodb + bson + 3.8.0 + + + + sqlite @@ -62,6 +124,19 @@ + + db2 + + db2 + + + + com.ibm.db2 + jcc + 11.5.8.0 + + + postgres @@ -75,6 +150,20 @@ + + snowflake + + snowflake + + + + + net.snowflake + snowflake-jdbc + 3.13.30 + + + mysql From 0607696edc2ae3fb7f79d8dae8a6dd723974a26f Mon Sep 17 00:00:00 2001 From: robert s lee Date: Mon, 27 Mar 2023 15:05:05 -0400 Subject: [PATCH 2/6] add informix and use lowercase names --- pom.xml | 35 ++- .../com/oltpbenchmark/types/DatabaseType.java | 8 +- .../benchmarks/sibench/ddl-sqlserver.sql | 5 + .../benchmarks/smallbank/ddl-informix.sql | 24 ++ .../benchmarks/smallbank/ddl-sqlserver.sql | 24 ++ .../benchmarks/tatp/ddl-informix.sql | 79 ++++++ .../benchmarks/tatp/ddl-sqlserver.sql | 138 +++++----- .../benchmarks/tpcc/ddl-informix.sql | 158 +++++++++++ .../benchmarks/tpcc/ddl-sqlserver.sql | 246 +++++++++--------- .../benchmarks/twitter/ddl-informix.sql | 58 +++++ .../benchmarks/voter/ddl-informix.sql | 54 ++++ .../benchmarks/voter/ddl-sqlserver.sql | 68 ++--- .../benchmarks/wikipedia/ddl-informix.sql | 241 +++++++++++++++++ .../benchmarks/ycsb/ddl-informix.sql | 14 + .../benchmarks/ycsb/ddl-sqlserver.sql | 28 +- src/main/resources/logging.properties | 2 +- 16 files changed, 937 insertions(+), 245 deletions(-) create mode 100644 src/main/resources/benchmarks/sibench/ddl-sqlserver.sql create mode 100644 src/main/resources/benchmarks/smallbank/ddl-informix.sql create mode 100644 src/main/resources/benchmarks/smallbank/ddl-sqlserver.sql create mode 100644 src/main/resources/benchmarks/tatp/ddl-informix.sql create mode 100644 src/main/resources/benchmarks/tpcc/ddl-informix.sql create mode 100644 src/main/resources/benchmarks/twitter/ddl-informix.sql create mode 100644 src/main/resources/benchmarks/voter/ddl-informix.sql create mode 100644 src/main/resources/benchmarks/wikipedia/ddl-informix.sql create mode 100644 src/main/resources/benchmarks/ycsb/ddl-informix.sql diff --git a/pom.xml b/pom.xml index 71a59d03d..0b578f7e9 100644 --- a/pom.xml +++ b/pom.xml @@ -186,7 +186,7 @@ org.mariadb.jdbc mariadb-java-client - 3.1.4 + 2.7.8 @@ -216,6 +216,19 @@ + + oracle + + oracle + + + + com.oracle.database.jdbc + ojdbc8 + 21.1.0.0 + + + phoenix @@ -242,6 +255,26 @@ + + informix + + informix + + + + + com.ibm.informix + jdbc + 4.50.3 + + + + org.mongodb + bson + 3.8.0 + + + diff --git a/src/main/java/com/oltpbenchmark/types/DatabaseType.java b/src/main/java/com/oltpbenchmark/types/DatabaseType.java index 00e3d2b74..5828ae6b6 100644 --- a/src/main/java/com/oltpbenchmark/types/DatabaseType.java +++ b/src/main/java/com/oltpbenchmark/types/DatabaseType.java @@ -35,7 +35,8 @@ public enum DatabaseType { DB2(true, false), H2(true, false), HSQLDB(false, false), - POSTGRES(false, false, true), + INFORMIX(false, false), + POSTGRES(false, false), MARIADB(true, false), MONETDB(false, false), MYROCKS(true, false), @@ -47,8 +48,9 @@ public enum DatabaseType { SPANNER(false, true), SQLAZURE(true, true, true), SQLITE(true, false), - SQLSERVER(true, true, true), - TIMESTEN(true, false), + SQLSERVER(true, false), + SYBASEASE(true, false), + TIMESTEN(true,false), PHOENIX(true, true); diff --git a/src/main/resources/benchmarks/sibench/ddl-sqlserver.sql b/src/main/resources/benchmarks/sibench/ddl-sqlserver.sql new file mode 100644 index 000000000..f0a3bfba1 --- /dev/null +++ b/src/main/resources/benchmarks/sibench/ddl-sqlserver.sql @@ -0,0 +1,5 @@ +drop table if exists sitest; +create table sitest ( + id int primary key, + value int not null +); \ No newline at end of file diff --git a/src/main/resources/benchmarks/smallbank/ddl-informix.sql b/src/main/resources/benchmarks/smallbank/ddl-informix.sql new file mode 100644 index 000000000..78bbfa71e --- /dev/null +++ b/src/main/resources/benchmarks/smallbank/ddl-informix.sql @@ -0,0 +1,24 @@ +drop table if exists checking; +drop table if exists savings; +drop table if exists accounts; + +create table accounts ( + custid bigint not null, + name varchar(64) not null, + primary key (custid) +); +create index idx_accounts_name on accounts (name); + +create table savings ( + custid bigint not null, + bal float not null, + primary key (custid), + foreign key (custid) references accounts (custid) +); + +create table checking ( + custid bigint not null, + bal float not null, + primary key (custid), + foreign key (custid) references accounts (custid) +); diff --git a/src/main/resources/benchmarks/smallbank/ddl-sqlserver.sql b/src/main/resources/benchmarks/smallbank/ddl-sqlserver.sql new file mode 100644 index 000000000..e83f3beba --- /dev/null +++ b/src/main/resources/benchmarks/smallbank/ddl-sqlserver.sql @@ -0,0 +1,24 @@ +drop table if exists checking; +drop table if exists savings; +drop table if exists accounts; + +create table accounts ( + custid bigint not null, + name varchar(64) not null, + constraint pk_accounts primary key (custid) +); +create index idx_accounts_name on accounts (name); + +create table savings ( + custid bigint not null, + bal float not null, + constraint pk_savings primary key (custid), + foreign key (custid) references accounts (custid) +); + +create table checking ( + custid bigint not null, + bal float not null, + constraint pk_checking primary key (custid), + foreign key (custid) references accounts (custid) +); diff --git a/src/main/resources/benchmarks/tatp/ddl-informix.sql b/src/main/resources/benchmarks/tatp/ddl-informix.sql new file mode 100644 index 000000000..8d3f9aa0f --- /dev/null +++ b/src/main/resources/benchmarks/tatp/ddl-informix.sql @@ -0,0 +1,79 @@ +drop table if exists call_forwarding; +drop table if exists special_facility; +drop table if exists access_info; +drop table if exists subscriber; + +create table subscriber +( + s_id integer not null primary key, + sub_nbr varchar(15) not null unique, + bit_1 smallint, + bit_2 smallint, + bit_3 smallint, + bit_4 smallint, + bit_5 smallint, + bit_6 smallint, + bit_7 smallint, + bit_8 smallint, + bit_9 smallint, + bit_10 smallint, + hex_1 smallint, + hex_2 smallint, + hex_3 smallint, + hex_4 smallint, + hex_5 smallint, + hex_6 smallint, + hex_7 smallint, + hex_8 smallint, + hex_9 smallint, + hex_10 smallint, + byte2_1 smallint, + byte2_2 smallint, + byte2_3 smallint, + byte2_4 smallint, + byte2_5 smallint, + byte2_6 smallint, + byte2_7 smallint, + byte2_8 smallint, + byte2_9 smallint, + byte2_10 smallint, + msc_location integer, + vlr_location integer +); + +create table access_info +( + s_id integer not null, + ai_type smallint not null, + data1 smallint, + data2 smallint, + data3 varchar(3), + data4 varchar(5), + primary key (s_id, ai_type), + foreign key (s_id) references subscriber (s_id) +); + + +create table special_facility +( + s_id integer not null, + sf_type smallint not null, + is_active smallint not null, + error_cntrl smallint, + data_a smallint, + data_b varchar(5), + primary key (s_id, sf_type), + foreign key (s_id) references subscriber (s_id) +); + +create table call_forwarding +( + s_id integer not null, + sf_type smallint not null, + start_time smallint not null, + end_time smallint, + numberx varchar(15), + primary key (s_id, sf_type, start_time), + foreign key (s_id, sf_type) references special_facility (s_id, sf_type) +); +create index idx_cf on call_forwarding (s_id); diff --git a/src/main/resources/benchmarks/tatp/ddl-sqlserver.sql b/src/main/resources/benchmarks/tatp/ddl-sqlserver.sql index d1ca37072..6415d8f7b 100644 --- a/src/main/resources/benchmarks/tatp/ddl-sqlserver.sql +++ b/src/main/resources/benchmarks/tatp/ddl-sqlserver.sql @@ -1,79 +1,79 @@ --- Drop Exisiting Tables -IF OBJECT_ID('ACCESS_INFO') IS NOT NULL DROP table ACCESS_INFO; -IF OBJECT_ID('CALL_FORWARDING') IS NOT NULL DROP table CALL_FORWARDING; -IF OBJECT_ID('SPECIAL_FACILITY') IS NOT NULL DROP table SPECIAL_FACILITY; -IF OBJECT_ID('SUBSCRIBER') IS NOT NULL DROP table SUBSCRIBER; +-- drop exisiting tables +if object_id('access_info') is not null drop table access_info; +if object_id('call_forwarding') is not null drop table call_forwarding; +if object_id('special_facility') is not null drop table special_facility; +if object_id('subscriber') is not null drop table subscriber; --- Create Tables +-- create tables -CREATE TABLE SUBSCRIBER ( - s_id INTEGER NOT NULL PRIMARY KEY, - sub_nbr VARCHAR(15) NOT NULL UNIQUE, - bit_1 TINYINT, - bit_2 TINYINT, - bit_3 TINYINT, - bit_4 TINYINT, - bit_5 TINYINT, - bit_6 TINYINT, - bit_7 TINYINT, - bit_8 TINYINT, - bit_9 TINYINT, - bit_10 TINYINT, - hex_1 TINYINT, - hex_2 TINYINT, - hex_3 TINYINT, - hex_4 TINYINT, - hex_5 TINYINT, - hex_6 TINYINT, - hex_7 TINYINT, - hex_8 TINYINT, - hex_9 TINYINT, - hex_10 TINYINT, - byte2_1 SMALLINT, - byte2_2 SMALLINT, - byte2_3 SMALLINT, - byte2_4 SMALLINT, - byte2_5 SMALLINT, - byte2_6 SMALLINT, - byte2_7 SMALLINT, - byte2_8 SMALLINT, - byte2_9 SMALLINT, - byte2_10 SMALLINT, - msc_location INTEGER, - vlr_location INTEGER +create table subscriber ( + s_id integer not null primary key, + sub_nbr varchar(15) not null unique, + bit_1 tinyint, + bit_2 tinyint, + bit_3 tinyint, + bit_4 tinyint, + bit_5 tinyint, + bit_6 tinyint, + bit_7 tinyint, + bit_8 tinyint, + bit_9 tinyint, + bit_10 tinyint, + hex_1 tinyint, + hex_2 tinyint, + hex_3 tinyint, + hex_4 tinyint, + hex_5 tinyint, + hex_6 tinyint, + hex_7 tinyint, + hex_8 tinyint, + hex_9 tinyint, + hex_10 tinyint, + byte2_1 smallint, + byte2_2 smallint, + byte2_3 smallint, + byte2_4 smallint, + byte2_5 smallint, + byte2_6 smallint, + byte2_7 smallint, + byte2_8 smallint, + byte2_9 smallint, + byte2_10 smallint, + msc_location integer, + vlr_location integer ); -CREATE TABLE ACCESS_INFO ( - s_id INTEGER NOT NULL, - ai_type TINYINT NOT NULL, - data1 SMALLINT, - data2 SMALLINT, - data3 VARCHAR(3), - data4 VARCHAR(5), - PRIMARY KEY(s_id, ai_type), - FOREIGN KEY (s_id) REFERENCES SUBSCRIBER (s_id) +create table access_info ( + s_id integer not null, + ai_type tinyint not null, + data1 smallint, + data2 smallint, + data3 varchar(3), + data4 varchar(5), + primary key(s_id, ai_type), + foreign key (s_id) references subscriber (s_id) ); -CREATE TABLE SPECIAL_FACILITY ( - s_id INTEGER NOT NULL, - sf_type TINYINT NOT NULL, - is_active TINYINT NOT NULL, - error_cntrl SMALLINT, - data_a SMALLINT, - data_b VARCHAR(5), - PRIMARY KEY (s_id, sf_type), - FOREIGN KEY (s_id) REFERENCES SUBSCRIBER (s_id) +create table special_facility ( + s_id integer not null, + sf_type tinyint not null, + is_active tinyint not null, + error_cntrl smallint, + data_a smallint, + data_b varchar(5), + primary key (s_id, sf_type), + foreign key (s_id) references subscriber (s_id) ); -CREATE TABLE CALL_FORWARDING ( - s_id INTEGER NOT NULL, - sf_type TINYINT NOT NULL, - start_time TINYINT NOT NULL, - end_time TINYINT, - numberx VARCHAR(15), - PRIMARY KEY (s_id, sf_type, start_time), - FOREIGN KEY (s_id, sf_type) REFERENCES SPECIAL_FACILITY(s_id, sf_type) +create table call_forwarding ( + s_id integer not null, + sf_type tinyint not null, + start_time tinyint not null, + end_time tinyint, + numberx varchar(15), + primary key (s_id, sf_type, start_time), + foreign key (s_id, sf_type) references special_facility(s_id, sf_type) ); --- Create Indexes -CREATE INDEX IDX_CF ON CALL_FORWARDING (S_ID); \ No newline at end of file +-- create indexes +create index idx_cf on call_forwarding (s_id); \ No newline at end of file diff --git a/src/main/resources/benchmarks/tpcc/ddl-informix.sql b/src/main/resources/benchmarks/tpcc/ddl-informix.sql new file mode 100644 index 000000000..eff1d1c13 --- /dev/null +++ b/src/main/resources/benchmarks/tpcc/ddl-informix.sql @@ -0,0 +1,158 @@ +drop table if exists order_line; +drop table if exists stock; +drop table if exists item; +drop table if exists history; +drop table if exists new_order; +drop table if exists oorder; +drop table if exists customer; +drop table if exists district; +drop table if exists warehouse; + +create table warehouse +( + w_id int not null, + w_ytd decimal(12, 2) not null, + w_tax decimal(4, 4) not null, + w_name varchar(10) not null, + w_street_1 varchar(20) not null, + w_street_2 varchar(20) not null, + w_city varchar(20) not null, + w_state char(2) not null, + w_zip char(9) not null, + primary key (w_id) +); + + +create table district +( + d_w_id int not null references warehouse (w_id), + d_id int not null, + d_ytd decimal(12, 2) not null, + d_tax decimal(4, 4) not null, + d_next_o_id int not null, + d_name varchar(10) not null, + d_street_1 varchar(20) not null, + d_street_2 varchar(20) not null, + d_city varchar(20) not null, + d_state char(2) not null, + d_zip char(9) not null, + primary key (d_w_id, d_id) +); + +-- todo: c_since on update current_timestamp, +create table customer +( + c_w_id int not null, + c_d_id int not null, + c_id int not null, + c_discount decimal(4, 4) not null, + c_credit char(2) not null, + c_last varchar(16) not null, + c_first varchar(16) not null, + c_credit_lim decimal(12, 2) not null, + c_balance decimal(12, 2) not null, + c_ytd_payment float not null, + c_payment_cnt int not null, + c_delivery_cnt int not null, + c_street_1 varchar(20) not null, + c_street_2 varchar(20) not null, + c_city varchar(20) not null, + c_state char(2) not null, + c_zip char(9) not null, + c_phone char(16) not null, + c_since datetime year to fraction(3) not null, + c_middle char(2) not null, + c_data text not null, + primary key (c_w_id, c_d_id, c_id), + foreign key (c_w_id, c_d_id) references district (d_w_id, d_id) +); +create index idx_customer_name on customer (c_w_id, c_d_id, c_last, c_first); + +-- todo: o_entry_d on update current_timestamp +create table oorder +( + o_w_id int not null, + o_d_id int not null, + o_id int not null, + o_c_id int not null, + o_carrier_id int default null, + o_ol_cnt int not null, + o_all_local int not null, + o_entry_d datetime year to fraction(3) not null, + primary key (o_w_id, o_d_id, o_id), + unique (o_w_id, o_d_id, o_c_id, o_id), + foreign key (o_w_id, o_d_id, o_c_id) references customer (c_w_id, c_d_id, c_id) +); + +create table new_order +( + no_w_id int not null, + no_d_id int not null, + no_o_id int not null, + primary key (no_w_id, no_d_id, no_o_id), + foreign key (no_w_id, no_d_id, no_o_id) references oorder (o_w_id, o_d_id, o_id) +); + +-- todo: h_date on update current_timestamp +create table history +( + h_c_id int not null, + h_c_d_id int not null, + h_c_w_id int not null, + h_d_id int not null, + h_w_id int not null, + h_date datetime year to fraction(3) not null, + h_amount decimal(6, 2) not null, + h_data varchar(24) not null, + foreign key (h_c_w_id, h_c_d_id, h_c_id) references customer (c_w_id, c_d_id, c_id), + foreign key (h_w_id, h_d_id) references district (d_w_id, d_id) +); + +create table item +( + i_id int not null, + i_name varchar(24) not null, + i_price decimal(5, 2) not null, + i_data varchar(50) not null, + i_im_id int not null, + primary key (i_id) +); + +create table stock +( + s_w_id int not null references warehouse (w_id), + s_i_id int not null references item (i_id), + s_quantity int not null, + s_ytd decimal(8, 2) not null, + s_order_cnt int not null, + s_remote_cnt int not null, + s_data varchar(50) not null, + s_dist_01 char(24) not null, + s_dist_02 char(24) not null, + s_dist_03 char(24) not null, + s_dist_04 char(24) not null, + s_dist_05 char(24) not null, + s_dist_06 char(24) not null, + s_dist_07 char(24) not null, + s_dist_08 char(24) not null, + s_dist_09 char(24) not null, + s_dist_10 char(24) not null, + primary key (s_w_id, s_i_id) +); + +create table order_line +( + ol_w_id int not null, + ol_d_id int not null, + ol_o_id int not null, + ol_number int not null, + ol_i_id int not null, + ol_delivery_d datetime year to fraction(3), + ol_amount decimal(6, 2) not null, + ol_supply_w_id int not null, + ol_quantity decimal(6, 2) not null, + ol_dist_info char(24) not null, + primary key (ol_w_id,ol_d_id,ol_o_id,ol_number), + foreign key (ol_w_id, ol_d_id, ol_o_id) references oorder (o_w_id, o_d_id, o_id), + foreign key (ol_supply_w_id, ol_i_id) references stock (s_w_id, s_i_id) +); diff --git a/src/main/resources/benchmarks/tpcc/ddl-sqlserver.sql b/src/main/resources/benchmarks/tpcc/ddl-sqlserver.sql index 89387fd62..37af98d74 100644 --- a/src/main/resources/benchmarks/tpcc/ddl-sqlserver.sql +++ b/src/main/resources/benchmarks/tpcc/ddl-sqlserver.sql @@ -1,144 +1,144 @@ --- DROP EXISTING TABLES -IF OBJECT_ID('WAREHOUSE') IS NOT NULL DROP TABLE WAREHOUSE; -IF OBJECT_ID('STOCK') IS NOT NULL DROP TABLE STOCK; -IF OBJECT_ID('ORDER_LINE') IS NOT NULL DROP TABLE ORDER_LINE; -IF OBJECT_ID('OORDER') IS NOT NULL DROP TABLE OORDER; -IF OBJECT_ID('NEW_ORDER') IS NOT NULL DROP TABLE NEW_ORDER; -IF OBJECT_ID('ITEM') IS NOT NULL DROP TABLE ITEM; -IF OBJECT_ID('HISTORY') IS NOT NULL DROP TABLE HISTORY; -IF OBJECT_ID('DISTRICT') IS NOT NULL DROP TABLE DISTRICT; -IF OBJECT_ID('CUSTOMER') IS NOT NULL DROP TABLE CUSTOMER; +-- drop existing tables +if object_id('warehouse') is not null drop table warehouse; +if object_id('stock') is not null drop table stock; +if object_id('order_line') is not null drop table order_line; +if object_id('oorder') is not null drop table oorder; +if object_id('new_order') is not null drop table new_order; +if object_id('item') is not null drop table item; +if object_id('history') is not null drop table history; +if object_id('district') is not null drop table district; +if object_id('customer') is not null drop table customer; --- CREATE TABLES +-- create tables -CREATE TABLE [dbo].[WAREHOUSE]( - [W_ID] [INT] NOT NULL, - [W_YTD] [DECIMAL](12, 2) NOT NULL, - [W_TAX] [DECIMAL](4, 4) NOT NULL, - [W_NAME] [VARCHAR](10) NOT NULL, - [W_STREET_1] [VARCHAR](20) NOT NULL, - [W_STREET_2] [VARCHAR](20) NOT NULL, - [W_CITY] [VARCHAR](20) NOT NULL, - [W_STATE] [CHAR](2) NOT NULL, - [W_ZIP] [CHAR](9) NOT NULL, - PRIMARY KEY (W_ID) +create table [dbo].[warehouse]( + [w_id] [int] not null, + [w_ytd] [decimal](12, 2) not null, + [w_tax] [decimal](4, 4) not null, + [w_name] [varchar](10) not null, + [w_street_1] [varchar](20) not null, + [w_street_2] [varchar](20) not null, + [w_city] [varchar](20) not null, + [w_state] [char](2) not null, + [w_zip] [char](9) not null, + primary key (w_id) ); -CREATE TABLE [dbo].[STOCK]( - [S_W_ID] [INT] NOT NULL, - [S_I_ID] [INT] NOT NULL, - [S_QUANTITY] [DECIMAL](4, 0) NOT NULL, - [S_YTD] [DECIMAL](8, 2) NOT NULL, - [S_ORDER_CNT] [INT] NOT NULL, - [S_REMOTE_CNT] [INT] NOT NULL, - [S_DATA] [VARCHAR](50) NOT NULL, - [S_DIST_01] [CHAR](24) NOT NULL, - [S_DIST_02] [CHAR](24) NOT NULL, - [S_DIST_03] [CHAR](24) NOT NULL, - [S_DIST_04] [CHAR](24) NOT NULL, - [S_DIST_05] [CHAR](24) NOT NULL, - [S_DIST_06] [CHAR](24) NOT NULL, - [S_DIST_07] [CHAR](24) NOT NULL, - [S_DIST_08] [CHAR](24) NOT NULL, - [S_DIST_09] [CHAR](24) NOT NULL, - [S_DIST_10] [CHAR](24) NOT NULL, - PRIMARY KEY (S_W_ID,S_I_ID) +create table [dbo].[stock]( + [s_w_id] [int] not null, + [s_i_id] [int] not null, + [s_quantity] [decimal](4, 0) not null, + [s_ytd] [decimal](8, 2) not null, + [s_order_cnt] [int] not null, + [s_remote_cnt] [int] not null, + [s_data] [varchar](50) not null, + [s_dist_01] [char](24) not null, + [s_dist_02] [char](24) not null, + [s_dist_03] [char](24) not null, + [s_dist_04] [char](24) not null, + [s_dist_05] [char](24) not null, + [s_dist_06] [char](24) not null, + [s_dist_07] [char](24) not null, + [s_dist_08] [char](24) not null, + [s_dist_09] [char](24) not null, + [s_dist_10] [char](24) not null, + primary key (s_w_id,s_i_id) ); -CREATE TABLE [dbo].[ORDER_LINE]( - [OL_W_ID] [INT] NOT NULL, - [OL_D_ID] [INT] NOT NULL, - [OL_O_ID] [INT] NOT NULL, - [OL_NUMBER] [INT] NOT NULL, - [OL_I_ID] [INT] NOT NULL, - [OL_DELIVERY_D] [DATETIME] NULL, - [OL_AMOUNT] [DECIMAL](6, 2) NOT NULL, - [OL_SUPPLY_W_ID] [INT] NOT NULL, - [OL_QUANTITY] [DECIMAL](2, 0) NOT NULL, - [OL_DIST_INFO] [CHAR](24) NOT NULL, - PRIMARY KEY (OL_W_ID,OL_D_ID,OL_O_ID,OL_NUMBER) +create table [dbo].[order_line]( + [ol_w_id] [int] not null, + [ol_d_id] [int] not null, + [ol_o_id] [int] not null, + [ol_number] [int] not null, + [ol_i_id] [int] not null, + [ol_delivery_d] [datetime] null, + [ol_amount] [decimal](6, 2) not null, + [ol_supply_w_id] [int] not null, + [ol_quantity] [decimal](2, 0) not null, + [ol_dist_info] [char](24) not null, + primary key (ol_w_id,ol_d_id,ol_o_id,ol_number) ); -CREATE TABLE [dbo].[OORDER]( - [O_W_ID] [INT] NOT NULL, - [O_D_ID] [INT] NOT NULL, - [O_ID] [INT] NOT NULL, - [O_C_ID] [INT] NOT NULL, - [O_CARRIER_ID] [INT] NULL, - [O_OL_CNT] [DECIMAL](2, 0) NOT NULL, - [O_ALL_LOCAL] [DECIMAL](1, 0) NOT NULL, - [O_ENTRY_D] [DATETIME] NULL, - PRIMARY KEY (O_W_ID,O_D_ID,O_ID), - UNIQUE (O_W_ID,O_D_ID,O_C_ID,O_ID) +create table [dbo].[oorder]( + [o_w_id] [int] not null, + [o_d_id] [int] not null, + [o_id] [int] not null, + [o_c_id] [int] not null, + [o_carrier_id] [int] null, + [o_ol_cnt] [decimal](2, 0) not null, + [o_all_local] [decimal](1, 0) not null, + [o_entry_d] [datetime] null, + primary key (o_w_id,o_d_id,o_id), + unique (o_w_id,o_d_id,o_c_id,o_id) ); -CREATE TABLE [dbo].[NEW_ORDER]( - [NO_W_ID] [INT] NOT NULL, - [NO_D_ID] [INT] NOT NULL, - [NO_O_ID] [INT] NOT NULL, - PRIMARY KEY (NO_W_ID,NO_D_ID,NO_O_ID) +create table [dbo].[new_order]( + [no_w_id] [int] not null, + [no_d_id] [int] not null, + [no_o_id] [int] not null, + primary key (no_w_id,no_d_id,no_o_id) ); -CREATE TABLE [dbo].[ITEM]( - [I_ID] [INT] NOT NULL, - [I_NAME] [VARCHAR](24) NOT NULL, - [I_PRICE] [DECIMAL](5, 2) NOT NULL, - [I_DATA] [VARCHAR](50) NOT NULL, - [I_IM_ID] [INT] NOT NULL, - PRIMARY KEY (I_ID) +create table [dbo].[item]( + [i_id] [int] not null, + [i_name] [varchar](24) not null, + [i_price] [decimal](5, 2) not null, + [i_data] [varchar](50) not null, + [i_im_id] [int] not null, + primary key (i_id) ); -CREATE TABLE [dbo].[HISTORY]( - [H_C_ID] [INT] NOT NULL, - [H_C_D_ID] [INT] NOT NULL, - [H_C_W_ID] [INT] NOT NULL, - [H_D_ID] [INT] NOT NULL, - [H_W_ID] [INT] NOT NULL, - [H_DATE] [DATETIME] NULL, - [H_AMOUNT] [DECIMAL](6, 2) NOT NULL, - [H_DATA] [VARCHAR](24) NOT NULL +create table [dbo].[history]( + [h_c_id] [int] not null, + [h_c_d_id] [int] not null, + [h_c_w_id] [int] not null, + [h_d_id] [int] not null, + [h_w_id] [int] not null, + [h_date] [datetime] null, + [h_amount] [decimal](6, 2) not null, + [h_data] [varchar](24) not null ); -CREATE TABLE [dbo].[DISTRICT]( - [D_W_ID] [INT] NOT NULL, - [D_ID] [INT] NOT NULL, - [D_YTD] [DECIMAL](12, 2) NOT NULL, - [D_TAX] [DECIMAL](4, 4) NOT NULL, - [D_NEXT_O_ID] [INT] NOT NULL, - [D_NAME] [VARCHAR](10) NOT NULL, - [D_STREET_1] [VARCHAR](20) NOT NULL, - [D_STREET_2] [VARCHAR](20) NOT NULL, - [D_CITY] [VARCHAR](20) NOT NULL, - [D_STATE] [CHAR](2) NOT NULL, - [D_ZIP] [CHAR](9) NOT NULL, - PRIMARY KEY (D_W_ID,D_ID) +create table [dbo].[district]( + [d_w_id] [int] not null, + [d_id] [int] not null, + [d_ytd] [decimal](12, 2) not null, + [d_tax] [decimal](4, 4) not null, + [d_next_o_id] [int] not null, + [d_name] [varchar](10) not null, + [d_street_1] [varchar](20) not null, + [d_street_2] [varchar](20) not null, + [d_city] [varchar](20) not null, + [d_state] [char](2) not null, + [d_zip] [char](9) not null, + primary key (d_w_id,d_id) ); -CREATE TABLE [dbo].[CUSTOMER]( - [C_W_ID] [INT] NOT NULL, - [C_D_ID] [INT] NOT NULL, - [C_ID] [INT] NOT NULL, - [C_DISCOUNT] [DECIMAL](4, 4) NOT NULL, - [C_CREDIT] [CHAR](2) NOT NULL, - [C_LAST] [VARCHAR](16) NOT NULL, - [C_FIRST] [VARCHAR](16) NOT NULL, - [C_CREDIT_LIM] [DECIMAL](12, 2) NOT NULL, - [C_BALANCE] [DECIMAL](12, 2) NOT NULL, - [C_YTD_PAYMENT] [REAL] NOT NULL, - [C_PAYMENT_CNT] [INT] NOT NULL, - [C_DELIVERY_CNT] [INT] NOT NULL, - [C_STREET_1] [VARCHAR](20) NOT NULL, - [C_STREET_2] [VARCHAR](20) NOT NULL, - [C_CITY] [VARCHAR](20) NOT NULL, - [C_STATE] [CHAR](2) NOT NULL, - [C_ZIP] [CHAR](9) NOT NULL, - [C_PHONE] [CHAR](16) NOT NULL, - [C_SINCE] [DATETIME] NULL, - [C_MIDDLE] [CHAR](2) NOT NULL, - [C_DATA] [VARCHAR](500) NOT NULL, - PRIMARY KEY (C_W_ID,C_D_ID,C_ID) +create table [dbo].[customer]( + [c_w_id] [int] not null, + [c_d_id] [int] not null, + [c_id] [int] not null, + [c_discount] [decimal](4, 4) not null, + [c_credit] [char](2) not null, + [c_last] [varchar](16) not null, + [c_first] [varchar](16) not null, + [c_credit_lim] [decimal](12, 2) not null, + [c_balance] [decimal](12, 2) not null, + [c_ytd_payment] [real] not null, + [c_payment_cnt] [int] not null, + [c_delivery_cnt] [int] not null, + [c_street_1] [varchar](20) not null, + [c_street_2] [varchar](20) not null, + [c_city] [varchar](20) not null, + [c_state] [char](2) not null, + [c_zip] [char](9) not null, + [c_phone] [char](16) not null, + [c_since] [datetime] null, + [c_middle] [char](2) not null, + [c_data] [varchar](500) not null, + primary key (c_w_id,c_d_id,c_id) ); --- CREATE INDEXES -CREATE INDEX IDX_CUSTOMER_NAME ON [dbo].[CUSTOMER] (C_W_ID,C_D_ID,C_LAST,C_FIRST); +-- create indexes +create index idx_customer_name on [dbo].[customer] (c_w_id,c_d_id,c_last,c_first); diff --git a/src/main/resources/benchmarks/twitter/ddl-informix.sql b/src/main/resources/benchmarks/twitter/ddl-informix.sql new file mode 100644 index 000000000..90931610f --- /dev/null +++ b/src/main/resources/benchmarks/twitter/ddl-informix.sql @@ -0,0 +1,58 @@ +-- MySQL ddl from Twitter dump + +DROP TABLE IF EXISTS added_tweets; +DROP TABLE IF EXISTS tweets; +DROP TABLE IF EXISTS followers; +DROP TABLE IF EXISTS follows; +DROP TABLE IF EXISTS user_profiles; + +CREATE TABLE user_profiles +( + uid int NOT NULL, + name varchar(255) DEFAULT NULL, + email varchar(255) DEFAULT NULL, + partitionid int DEFAULT NULL, + partitionid2 SMALLINT DEFAULT NULL, + followers int DEFAULT NULL, + PRIMARY KEY (uid) +); +CREATE INDEX IDX_USER_FOLLOWERS ON user_profiles (followers); +CREATE INDEX IDX_USER_PARTITION ON user_profiles (partitionid); + +CREATE TABLE followers +( + f1 int NOT NULL REFERENCES user_profiles (uid), + f2 int NOT NULL REFERENCES user_profiles (uid), + PRIMARY KEY (f1, f2) +); + +CREATE TABLE follows +( + f1 int NOT NULL REFERENCES user_profiles (uid), + f2 int NOT NULL REFERENCES user_profiles (uid), + PRIMARY KEY (f1, f2) +); + +-- TODO: id AUTO_INCREMENT +CREATE TABLE tweets +( + id bigint NOT NULL, + uid int NOT NULL REFERENCES user_profiles (uid), + text char(140) NOT NULL, + createdate DATETIME YEAR TO FRACTION(3) DEFAULT NULL, + PRIMARY KEY (id) +); +-- informix auto creates based on references +-- CREATE INDEX IDX_TWEETS_UID ON tweets (uid); + +-- TODO: id auto_increment +CREATE TABLE added_tweets +( + id bigint NOT NULL, + uid int NOT NULL REFERENCES user_profiles (uid), + text char(140) NOT NULL, + createdate DATETIME YEAR TO FRACTION(3) DEFAULT NULL, + PRIMARY KEY (id) +); +-- informix auto creates based on references +-- CREATE INDEX IDX_ADDED_TWEETS_UID ON added_tweets (uid); diff --git a/src/main/resources/benchmarks/voter/ddl-informix.sql b/src/main/resources/benchmarks/voter/ddl-informix.sql new file mode 100644 index 000000000..bc4f661ae --- /dev/null +++ b/src/main/resources/benchmarks/voter/ddl-informix.sql @@ -0,0 +1,54 @@ +drop view if exists v_votes_by_phone_number; +drop view if exists v_votes_by_contestant_number_state; +drop table if exists votes; +drop table if exists area_code_state; +drop table if exists contestants; + +-- contestants table holds the contestants numbers (for voting) and names +create table contestants +( + contestant_number integer not null, + contestant_name varchar(50) not null, + primary key (contestant_number) +); + +-- map of area codes and states for geolocation classification of incoming calls +create table area_code_state +( + area_code smallint not null, + state varchar(2) not null, + primary key ( area_code ) +); + +-- votes table holds every valid vote. +-- voters are not allowed to submit more than votes, x is passed to client application +create table votes +( + vote_id bigint not null, + phone_number bigint not null, + state varchar(2) not null, + contestant_number integer not null references contestants (contestant_number), + created datetime year to fraction(3) not null +); +-- informix auto creates based on references +-- create index idx_votes_phone_number on votes (phone_number); + +-- rollup of votes by phone number, used to reject excessive voting +create view v_votes_by_phone_number +( + phone_number, num_votes +) +as + select phone_number, count(*) + from votes + group by phone_number; + +-- rollup of votes by contestant and state for the heat map and results +create view v_votes_by_contestant_number_state +( + contestant_number, state, num_votes +) +as + select contestant_number, state , count(*) + from votes + group by contestant_number, state; diff --git a/src/main/resources/benchmarks/voter/ddl-sqlserver.sql b/src/main/resources/benchmarks/voter/ddl-sqlserver.sql index f7edc5633..de1373860 100644 --- a/src/main/resources/benchmarks/voter/ddl-sqlserver.sql +++ b/src/main/resources/benchmarks/voter/ddl-sqlserver.sql @@ -1,27 +1,27 @@ --- Drop all views / tables -IF OBJECT_ID('V_VOTES_BY_PHONE_NUMBER') IS NOT NULL DROP view V_VOTES_BY_PHONE_NUMBER; -IF OBJECT_ID('V_VOTES_BY_CONTESTANT_NUMBER_STATE') IS NOT NULL DROP view V_VOTES_BY_CONTESTANT_NUMBER_STATE; -IF OBJECT_ID('AREA_CODE_STATE') IS NOT NULL DROP table AREA_CODE_STATE; -IF OBJECT_ID('VOTES') IS NOT NULL DROP table VOTES; -IF OBJECT_ID('CONTESTANTS') IS NOT NULL DROP table CONTESTANTS; +-- drop all views / tables +if object_id('v_votes_by_phone_number') is not null drop view v_votes_by_phone_number; +if object_id('v_votes_by_contestant_number_state') is not null drop view v_votes_by_contestant_number_state; +if object_id('area_code_state') is not null drop table area_code_state; +if object_id('votes') is not null drop table votes; +if object_id('contestants') is not null drop table contestants; -- contestants table holds the contestants numbers (for voting) and names -CREATE TABLE CONTESTANTS +create table contestants ( - contestant_number integer NOT NULL -, contestant_name varchar(50) NOT NULL -, PRIMARY KEY + contestant_number integer not null +, contestant_name varchar(50) not null +, primary key ( contestant_number ) ); --- Map of Area Codes and States for geolocation classification of incoming calls -CREATE TABLE AREA_CODE_STATE +-- map of area codes and states for geolocation classification of incoming calls +create table area_code_state ( - area_code smallint NOT NULL -, state varchar(2) NOT NULL -, PRIMARY KEY + area_code smallint not null +, state varchar(2) not null +, primary key ( area_code ) @@ -29,41 +29,41 @@ CREATE TABLE AREA_CODE_STATE -- votes table holds every valid vote. -- voters are not allowed to submit more than votes, x is passed to client application -CREATE TABLE VOTES +create table votes ( - vote_id bigint NOT NULL -, phone_number bigint NOT NULL -, state varchar(2) NOT NULL -, contestant_number integer NOT NULL REFERENCES CONTESTANTS (contestant_number) -, created datetime2 NOT NULL DEFAULT (CURRENT_TIMESTAMP) + vote_id bigint not null +, phone_number bigint not null +, state varchar(2) not null +, contestant_number integer not null references contestants (contestant_number) +, created timestamp not null ); -CREATE INDEX idx_votes_phone_number ON VOTES (phone_number); +create index idx_votes_phone_number on votes (phone_number); -- rollup of votes by phone number, used to reject excessive voting -CREATE VIEW V_VOTES_BY_PHONE_NUMBER +create view v_votes_by_phone_number ( phone_number , num_votes ) -AS - SELECT phone_number - , COUNT(*) - FROM VOTES - GROUP BY phone_number +as + select phone_number + , count(*) + from votes + group by phone_number ; -- rollup of votes by contestant and state for the heat map and results -CREATE VIEW V_VOTES_BY_CONTESTANT_NUMBER_STATE +create view v_votes_by_contestant_number_state ( contestant_number , state , num_votes ) -AS - SELECT contestant_number +as + select contestant_number , state - , COUNT(*) - FROM VOTES - GROUP BY contestant_number + , count(*) + from votes + group by contestant_number , state ; diff --git a/src/main/resources/benchmarks/wikipedia/ddl-informix.sql b/src/main/resources/benchmarks/wikipedia/ddl-informix.sql new file mode 100644 index 000000000..f6670c921 --- /dev/null +++ b/src/main/resources/benchmarks/wikipedia/ddl-informix.sql @@ -0,0 +1,241 @@ +-- TODO: ipb_id auto_increment + +DROP TABLE IF EXISTS watchlist; +DROP TABLE IF EXISTS value_backup; +DROP TABLE IF EXISTS user_groups; +DROP TABLE IF EXISTS text; +DROP TABLE IF EXISTS revision; +DROP TABLE IF EXISTS recentchanges; +DROP TABLE IF EXISTS page_restrictions; +DROP TABLE IF EXISTS page_backup; +DROP TABLE IF EXISTS page; +DROP TABLE IF EXISTS logging; +DROP TABLE IF EXISTS useracct; +DROP TABLE IF EXISTS ipblocks; + + +CREATE TABLE ipblocks +( + ipb_id int NOT NULL, + ipb_address text NOT NULL, + ipb_user int NOT NULL, + ipb_by int NOT NULL, + ipb_by_text text NOT NULL, + ipb_reason text NOT NULL, + ipb_timestamp varchar(14) NOT NULL, + ipb_auto SMALLINT NOT NULL, + ipb_anon_only SMALLINT NOT NULL, + ipb_create_account SMALLINT NOT NULL , + ipb_enable_autoblock SMALLINT NOT NULL , + ipb_expiry varchar(14) NOT NULL, + ipb_range_start text NOT NULL, + ipb_range_end text NOT NULL, + ipb_deleted SMALLINT NOT NULL , + ipb_block_email SMALLINT NOT NULL , + ipb_allow_usertalk SMALLINT NOT NULL , + PRIMARY KEY (ipb_id), + UNIQUE (ipb_address, ipb_user, ipb_auto, ipb_anon_only) +); + +CREATE INDEX IDX_IPB_USER ON ipblocks (ipb_user); +CREATE INDEX IDX_IPB_RANGE ON ipblocks (ipb_range_start, ipb_range_end); +CREATE INDEX IDX_IPB_TIMESTAMP ON ipblocks (ipb_timestamp); +CREATE INDEX IDX_IPB_EXPIRY ON ipblocks (ipb_expiry); + +-- TOOD: user_id auto_increment +CREATE TABLE useracct +( + user_id int NOT NULL, + user_name text NOT NULL, + user_real_name text NOT NULL, + user_password text NOT NULL, + user_newpassword text NOT NULL, + user_newpass_time varchar(14) DEFAULT NULL, + user_email text NOT NULL, + user_options text NOT NULL, + user_touched varchar(14) NOT NULL, + user_token char(32) NOT NULL, + user_email_authenticated char(14) DEFAULT NULL, + user_email_token char(32) DEFAULT NULL, + user_email_token_expires char(14) DEFAULT NULL, + user_registration varchar(14) DEFAULT NULL, + user_editcount int DEFAULT NULL, + PRIMARY KEY (user_id), + UNIQUE (user_name) +); +CREATE INDEX IDX_USER_EMAIL_TOKEN ON useracct (user_email_token); + +-- TODO: log_id auto_increment +CREATE TABLE logging +( + log_id int NOT NULL, + log_type varchar(32) NOT NULL, + log_action varchar(32) NOT NULL, + log_timestamp varchar(14) NOT NULL, + log_user int NOT NULL, + log_namespace int NOT NULL, + log_title text NOT NULL, + log_comment text NOT NULL, + log_params text NOT NULL, + log_deleted SMALLINT NOT NULL, + log_user_text text NOT NULL, + log_page int DEFAULT NULL, + PRIMARY KEY (log_id) +); +CREATE INDEX IDX_LOG_TYPE_TIME ON logging (log_type, log_timestamp); +CREATE INDEX IDX_LOG_USER_TIME ON logging (log_user, log_timestamp); +CREATE INDEX IDX_LOG_PAGE_TIME ON logging (log_namespace, log_title, log_timestamp); +CREATE INDEX IDX_LOG_TIMES ON logging (log_timestamp); +CREATE INDEX IDX_LOG_USER_TYPE_TIME ON logging (log_user, log_type, log_timestamp); +CREATE INDEX IDX_LOG_PAGE_ID_TIME ON logging (log_page, log_timestamp); + +-- TODO: page_id auto_increment +CREATE TABLE page +( + page_id int NOT NULL, + page_namespace int NOT NULL, + page_title text NOT NULL, + page_restrictions text NOT NULL, + page_counter bigint NOT NULL, + page_is_redirect SMALLINT NOT NULL, + page_is_new SMALLINT NOT NULL, + page_random double NOT NULL, + page_touched varchar(14) NOT NULL, + page_latest int NOT NULL, + page_len int NOT NULL, + PRIMARY KEY (page_id), + UNIQUE (page_namespace, page_title) +); +CREATE INDEX IDX_PAGE_RANDOM ON page (page_random); +CREATE INDEX IDX_PAGE_LEN ON page (page_len); + +-- TODO: page_id auto_increment +CREATE TABLE page_backup +( + page_id int NOT NULL, + page_namespace int NOT NULL, + page_title text NOT NULL, + page_restrictions text NOT NULL, + page_counter bigint NOT NULL, + page_is_redirect SMALLINT NOT NULL, + page_is_new SMALLINT NOT NULL, + page_random double NOT NULL, + page_touched varchar(14) NOT NULL, + page_latest int NOT NULL, + page_len int NOT NULL, + PRIMARY KEY (page_id), + UNIQUE (page_namespace, page_title) +); +CREATE INDEX IDX_PAGE_BACKUP_RANDOM ON page_backup (page_random); +CREATE INDEX IDX_PAGE_BACKUP_LEN ON page_backup (page_len); + +CREATE TABLE page_restrictions +( + pr_page int NOT NULL, + pr_type varchar(60) NOT NULL, + pr_level varchar(60) NOT NULL, + pr_cascade SMALLINT NOT NULL, + pr_user int DEFAULT NULL, + pr_expiry varchar(14) DEFAULT NULL, + pr_id int NOT NULL, + PRIMARY KEY (pr_id), + UNIQUE (pr_page, pr_type) +); +CREATE INDEX IDX_PR_TYPELEVEL ON page_restrictions (pr_type, pr_level); +CREATE INDEX IDX_PR_LEVEL ON page_restrictions (pr_level); +CREATE INDEX IDX_PR_CASCADE ON page_restrictions (pr_cascade); + +-- TOOD: rc_id auto_increment +CREATE TABLE recentchanges +( + rc_id int NOT NULL, + rc_timestamp varchar(14) NOT NULL, + rc_cur_time varchar(14) NOT NULL, + rc_user int NOT NULL, + rc_user_text text NOT NULL, + rc_namespace int NOT NULL, + rc_title text NOT NULL, + rc_comment text NOT NULL, + rc_minor SMALLINT NOT NULL, + rc_bot SMALLINT NOT NULL, + rc_new SMALLINT NOT NULL, + rc_cur_id int NOT NULL, + rc_this_oldid int NOT NULL, + rc_last_oldid int NOT NULL, + rc_type SMALLINT NOT NULL, + rc_moved_to_ns SMALLINT NOT NULL, + rc_moved_to_title text NOT NULL, + rc_patrolled SMALLINT NOT NULL, + rc_ip varchar(40) NOT NULL, + rc_old_len int DEFAULT NULL, + rc_new_len int DEFAULT NULL, + rc_deleted SMALLINT NOT NULL, + rc_logid int NOT NULL, + rc_log_type text DEFAULT NULL, + rc_log_action text DEFAULT NULL, + rc_params text, + PRIMARY KEY (rc_id) +); +CREATE INDEX IDX_RC_TIMESTAMP ON recentchanges (rc_timestamp); +CREATE INDEX IDX_RC_NAMESPACE_TITLE ON recentchanges (rc_namespace, rc_title); +CREATE INDEX IDX_RC_CUR_ID ON recentchanges (rc_cur_id); +CREATE INDEX IDX_NEW_NAME_TIMESTAMP ON recentchanges (rc_new, rc_namespace, rc_timestamp); +CREATE INDEX IDX_RC_IP ON recentchanges (rc_ip); +CREATE INDEX IDX_RC_NS_USERTEXT ON recentchanges (rc_namespace, rc_user_text); +CREATE INDEX IDX_RC_USER_TEXT ON recentchanges (rc_user_text, rc_timestamp); + +-- TODO: rev_id auto_increment +CREATE TABLE revision +( + rev_id int NOT NULL, + rev_page int NOT NULL, + rev_text_id int NOT NULL, + rev_comment text NOT NULL, + rev_user int NOT NULL, + rev_user_text text NOT NULL, + rev_timestamp varchar(14) NOT NULL, + rev_minor_edit SMALLINT NOT NULL, + rev_deleted SMALLINT NOT NULL, + rev_len int DEFAULT NULL, + rev_parent_id int DEFAULT NULL, + PRIMARY KEY (rev_id), + UNIQUE (rev_page, rev_id) +); +CREATE INDEX IDX_REV_TIMESTAMP ON revision (rev_timestamp); +CREATE INDEX IDX_PAGE_TIMESTAMP ON revision (rev_page, rev_timestamp); +CREATE INDEX IDX_USER_TIMESTAMP ON revision (rev_user, rev_timestamp); +CREATE INDEX IDX_USERTEXT_TIMESTAMP ON revision (rev_user_text, rev_timestamp); + +-- TODO old_id auto_increment +CREATE TABLE text +( + old_id int NOT NULL, + old_text TEXT NOT NULL, + old_flags text NOT NULL, + old_page int DEFAULT NULL, + PRIMARY KEY (old_id) +); + +CREATE TABLE user_groups +( + ug_user int NOT NULL REFERENCES useracct (user_id), + ug_group varchar(16) NOT NULL, + UNIQUE (ug_user, ug_group) +); +CREATE INDEX IDX_UG_GROUP ON user_groups (ug_group); + +CREATE TABLE value_backup +( + table_name text DEFAULT NULL, + maxid int DEFAULT NULL +); + +CREATE TABLE watchlist +( + wl_user int NOT NULL, + wl_namespace int NOT NULL, + wl_title text NOT NULL, + wl_notificationtimestamp varchar(14) DEFAULT NULL, + UNIQUE (wl_user, wl_namespace, wl_title) +); +CREATE INDEX IDX_WL_NAMESPACE_TITLE ON watchlist (wl_namespace, wl_title); diff --git a/src/main/resources/benchmarks/ycsb/ddl-informix.sql b/src/main/resources/benchmarks/ycsb/ddl-informix.sql new file mode 100644 index 000000000..eca277818 --- /dev/null +++ b/src/main/resources/benchmarks/ycsb/ddl-informix.sql @@ -0,0 +1,14 @@ +drop table if exists usertable; +create table usertable ( + ycsb_key int primary key, + field1 varchar(100), + field2 varchar(100), + field3 varchar(100), + field4 varchar(100), + field5 varchar(100), + field6 varchar(100), + field7 varchar(100), + field8 varchar(100), + field9 varchar(100), + field10 varchar(100) +); \ No newline at end of file diff --git a/src/main/resources/benchmarks/ycsb/ddl-sqlserver.sql b/src/main/resources/benchmarks/ycsb/ddl-sqlserver.sql index 180a63eaa..175d2b110 100644 --- a/src/main/resources/benchmarks/ycsb/ddl-sqlserver.sql +++ b/src/main/resources/benchmarks/ycsb/ddl-sqlserver.sql @@ -1,17 +1,17 @@ --- YCSB DDL for Microsoft SQL Server +-- ycsb ddl for microsoft sql server -IF OBJECT_ID('USERTABLE') IS NOT NULL DROP table USERTABLE; +if object_id('usertable') is not null drop table usertable; -CREATE TABLE USERTABLE( - YCSB_KEY INT PRIMARY KEY, - FIELD1 TEXT, - FIELD2 TEXT, - FIELD3 TEXT, - FIELD4 TEXT, - FIELD5 TEXT, - FIELD6 TEXT, - FIELD7 TEXT, - FIELD8 TEXT, - FIELD9 TEXT, - FIELD10 TEXT +create table usertable( + ycsb_key int primary key, + field1 text, + field2 text, + field3 text, + field4 text, + field5 text, + field6 text, + field7 text, + field8 text, + field9 text, + field10 text ); diff --git a/src/main/resources/logging.properties b/src/main/resources/logging.properties index b8d3b4686..84ce1796f 100644 --- a/src/main/resources/logging.properties +++ b/src/main/resources/logging.properties @@ -1,7 +1,7 @@ # Specify the handler, the handlers will be installed during VM startup. handlers=java.util.logging.ConsoleHandler # Default global logging level. -.level=OFF +.level=FINEST java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter java.util.logging.ConsoleHandler.level=FINEST java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %4$s %2$s %5$s%6$s%n From cfd3ed449419c247307907c2080b93cf58bce12b Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 4 Apr 2023 17:36:37 -0500 Subject: [PATCH 3/6] Combine several dependabot updates to a single PR (#291) Closes #285 Closes #286 Closes #287 Closes #288 Closes #289 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0b578f7e9..d14221c41 100644 --- a/pom.xml +++ b/pom.xml @@ -199,7 +199,7 @@ com.google.cloud google-cloud-spanner-jdbc - 2.9.16 + 2.9.13 From b33fb1958833d8ddda4b9af5fc568d8af77b93a6 Mon Sep 17 00:00:00 2001 From: robert s lee Date: Mon, 27 Mar 2023 15:05:05 -0400 Subject: [PATCH 4/6] Add support for SybaseASE --- config/informix/sample_tpcc_config.xml | 54 ++++++ config/informix/sample_ycsb_config.xml | 47 ++++++ config/sybase/sample_tpcc_config.xml | 55 ++++++ config/sybase/sample_ycsb_config.xml | 48 ++++++ pom-arcion.xml | 157 +++++++++++++++--- pom.xml | 31 +++- .../oltpbenchmark/WorkloadConfiguration.java | 9 +- .../com/oltpbenchmark/api/LoaderThread.java | 16 +- .../java/com/oltpbenchmark/api/Worker.java | 9 + .../benchmarks/tpcc/TPCCLoader.java | 5 +- .../benchmarks/ycsb/YCSBBenchmark.java | 2 +- .../java/com/oltpbenchmark/util/SQLUtil.java | 9 +- .../benchmarks/tpcc/ddl-sybasease.sql | 148 +++++++++++++++++ .../benchmarks/tpcc/dialect-sybasease.xml | 32 ++++ .../benchmarks/ycsb/ddl-sybasease.sql | 20 +++ .../benchmarks/ycsb/dialect-sybasease.xml | 38 +++++ 16 files changed, 645 insertions(+), 35 deletions(-) create mode 100644 config/informix/sample_tpcc_config.xml create mode 100644 config/informix/sample_ycsb_config.xml create mode 100644 config/sybase/sample_tpcc_config.xml create mode 100644 config/sybase/sample_ycsb_config.xml create mode 100644 src/main/resources/benchmarks/tpcc/ddl-sybasease.sql create mode 100644 src/main/resources/benchmarks/tpcc/dialect-sybasease.xml create mode 100644 src/main/resources/benchmarks/ycsb/ddl-sybasease.sql create mode 100644 src/main/resources/benchmarks/ycsb/dialect-sybasease.xml diff --git a/config/informix/sample_tpcc_config.xml b/config/informix/sample_tpcc_config.xml new file mode 100644 index 000000000..962407d8d --- /dev/null +++ b/config/informix/sample_tpcc_config.xml @@ -0,0 +1,54 @@ + + + + + INFORMIX + com.informix.jdbc.IfxDriver + jdbc:informix-sqli://localhost:9088/demo:INFORMIXSERVER=informix;user=informix;password=in4mix;sslMode=DISABLED + informix + in4mix + TRANSACTION_SERIALIZABLE + 128 + + + 4 + + + 2 + + + + 10000 + 45,43,4,4,4 + + + + + + + NewOrder + + + + + Payment + + + + + OrderStatus + + + + + Delivery + + + + + StockLevel + + + + + diff --git a/config/informix/sample_ycsb_config.xml b/config/informix/sample_ycsb_config.xml new file mode 100644 index 000000000..5e960a080 --- /dev/null +++ b/config/informix/sample_ycsb_config.xml @@ -0,0 +1,47 @@ + + + + + INFORMIX + com.informix.jdbc.IfxDriver + jdbc:informix-sqli://localhost:9088/demo:INFORMIXSERVER=informix;user=informix;password=in4mix;sslMode=DISABLED + informix + in4mix + TRANSACTION_SERIALIZABLE + 128 + + + 1 + + + 1 + + + + 10000 + 50,5,15,10,10,10 + + + + + + + ReadRecord + + + InsertRecord + + + ScanRecord + + + UpdateRecord + + + DeleteRecord + + + ReadModifyWriteRecord + + + diff --git a/config/sybase/sample_tpcc_config.xml b/config/sybase/sample_tpcc_config.xml new file mode 100644 index 000000000..bb6bccb19 --- /dev/null +++ b/config/sybase/sample_tpcc_config.xml @@ -0,0 +1,55 @@ + + + + + SybaseASE + com.sybase.jdbc4.jdbc.SybDriver + jdbc:sybase:Tds:localhost:8000/test + sa + myPassword + TRANSACTION_SERIALIZABLE + 128 + + + 1 + + + 1 + + + + 10000 + 45,43,4,4,4 + + + + + + + NewOrder + + + + + Payment + + + + + OrderStatus + + + + + Delivery + + + + + StockLevel + + + + + + diff --git a/config/sybase/sample_ycsb_config.xml b/config/sybase/sample_ycsb_config.xml new file mode 100644 index 000000000..fa9b55a5c --- /dev/null +++ b/config/sybase/sample_ycsb_config.xml @@ -0,0 +1,48 @@ + + + + + SybaseASE + com.sybase.jdbc4.jdbc.SybDriver + jdbc:sybase:Tds:localhost:8000/demo + sa + myPassword + TRANSACTION_SERIALIZABLE + 128 + + + 1 + + + 1 + + + + 10000 + 50,5,15,10,10,10 + + + + + + + ReadRecord + + + InsertRecord + + + ScanRecord + + + UpdateRecord + + + DeleteRecord + + + ReadModifyWriteRecord + + + + diff --git a/pom-arcion.xml b/pom-arcion.xml index 34d1bcf2a..4d2e3e0d5 100644 --- a/pom-arcion.xml +++ b/pom-arcion.xml @@ -16,6 +16,21 @@ 17 17 ${project.basedir}/target + + + src/main/assembly/tgz.xml,src/main/assembly/zip.xml + @@ -34,6 +49,81 @@ + + arcion + + + jumpmind + jumpmind + https://maven.jumpmind.com/repo + + + + arcion + + + + org.xerial + sqlite-jdbc + 3.36.0.3 + + + com.ibm.db2 + jcc + 11.5.8.0 + + + org.postgresql + postgresql + 42.4.0 + + + + net.snowflake + snowflake-jdbc + 3.13.30 + + + mysql + mysql-connector-java + 8.0.29 + + + org.mariadb.jdbc + mariadb-java-client + 2.7.8 + + + com.oracle.database.jdbc + ojdbc8 + 21.1.0.0 + + + com.microsoft.sqlserver + mssql-jdbc + 11.2.3.jre17 + + + + com.ibm.informix + jdbc + 4.50.3 + + + + org.mongodb + bson + 3.8.0 + + + + jdbc.sybase + jconn4 + 16.0 + + + + sqlite @@ -43,7 +133,7 @@ org.xerial sqlite-jdbc - 3.36.0.3 + 3.41.2.1 @@ -56,10 +146,22 @@ com.ibm.db2 jcc - 11.5.8.0 + 11.5.8.0 - + + + sybase + + sybase + + + + jdbc.sybase + jconn4 + 16.0 + + postgres @@ -69,7 +171,7 @@ org.postgresql postgresql - 42.4.0 + 42.6.0 @@ -96,7 +198,7 @@ mysql mysql-connector-java - 8.0.29 + 8.0.30 @@ -122,7 +224,7 @@ com.google.cloud google-cloud-spanner-jdbc - 2.6.1 + 2.9.13 @@ -135,7 +237,7 @@ org.postgresql postgresql - 42.4.0 + 42.6.0 @@ -204,19 +306,19 @@ org.slf4j slf4j-api - 1.7.36 + 2.0.7 org.slf4j slf4j-reload4j - 1.7.36 + 2.0.7 org.apache.commons commons-configuration2 - 2.8.0 + 2.9.0 @@ -258,7 +360,7 @@ org.json json - 20220320 + 20230227 @@ -270,7 +372,7 @@ org.glassfish.jaxb jaxb-runtime - 4.0.0 + 4.0.2 @@ -286,7 +388,6 @@ test - @@ -295,7 +396,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.11.0 ${maven.compiler.source} ${maven.compiler.target} @@ -304,7 +405,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.2 + 3.3.0 ${classifier} @@ -321,21 +422,19 @@ org.apache.maven.plugins maven-assembly-plugin - 3.4.1 + 3.5.0 + + false + ${project.artifactId}-${classifier} + false + ${descriptors} + package single - - false - ${project.artifactId}-${classifier} - - src/main/assembly/tgz.xml - src/main/assembly/zip.xml - - @@ -356,7 +455,7 @@ maven-release-plugin - 2.5.3 + 3.0.0 false v@{version} @@ -376,16 +475,22 @@ + true ${project.build.outputDirectory}/git.properties full true + true + false org.apache.maven.plugins maven-dependency-plugin - 3.3.0 + 3.5.0 analyze diff --git a/pom.xml b/pom.xml index d14221c41..5a3cf79ac 100644 --- a/pom.xml +++ b/pom.xml @@ -51,6 +51,13 @@ arcion + + + jumpmind + jumpmind + https://maven.jumpmind.com/repo + + arcion @@ -108,6 +115,12 @@ bson 3.8.0 + + + jdbc.sybase + jconn4 + 16.0 + @@ -134,9 +147,23 @@ com.ibm.db2 jcc 11.5.8.0 - + - + + + sybase + + sybase + + + + + jdbc.sybase + jconn4 + 16.0 + + + postgres diff --git a/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java b/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java index 68fa03cbc..64f8adbe1 100644 --- a/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java +++ b/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java @@ -253,10 +253,15 @@ public void setDDLPath(String ddlPath) { */ public void init() { try { - Class.forName(this.driverClass); + // The newInstance() call is a work around for some broken Java implementations + Class.forName(this.driverClass).newInstance(); } catch (ClassNotFoundException ex) { throw new RuntimeException("Failed to initialize JDBC driver '" + this.driverClass + "'", ex); - } + } catch (java.lang.InstantiationException ex) { + throw new RuntimeException("Failed to initialize JDBC driver '" + this.driverClass + "'", ex); + } catch (java.lang.IllegalAccessException ex) { + throw new RuntimeException("Failed to initialize JDBC driver '" + this.driverClass + "'", ex); + } } public int getTerminals() { diff --git a/src/main/java/com/oltpbenchmark/api/LoaderThread.java b/src/main/java/com/oltpbenchmark/api/LoaderThread.java index 50f4ba9c3..a4699d95f 100644 --- a/src/main/java/com/oltpbenchmark/api/LoaderThread.java +++ b/src/main/java/com/oltpbenchmark/api/LoaderThread.java @@ -20,9 +20,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.oltpbenchmark.types.DatabaseType; + import java.sql.Connection; +import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.Statement; + /** * A LoaderThread is responsible for loading some portion of a * benchmark's database. @@ -41,7 +46,16 @@ public LoaderThread(BenchmarkModule benchmarkModule) { @Override public final void run() { beforeLoad(); - try (Connection conn = benchmarkModule.makeConnection()) { + try (Connection conn = benchmarkModule.makeConnection()) { + DatabaseType databaseType = benchmarkModule.getWorkloadConfiguration().getDatabaseType(); + if ( databaseType == DatabaseType.SYBASEASE ) { + LOG.info("Sybase ASE: Running set arithabort numeric_truncation off"); + try (Statement stmt = conn.createStatement()) { + int result = stmt.executeUpdate("set arithabort numeric_truncation off"); + } catch (SQLException e) { + LOG.info(e.getMessage()); + } + } load(conn); } catch (SQLException ex) { SQLException next_ex = ex.getNextException(); diff --git a/src/main/java/com/oltpbenchmark/api/Worker.java b/src/main/java/com/oltpbenchmark/api/Worker.java index f1cdf68ee..ecf589ed1 100644 --- a/src/main/java/com/oltpbenchmark/api/Worker.java +++ b/src/main/java/com/oltpbenchmark/api/Worker.java @@ -79,6 +79,15 @@ public Worker(T benchmark, int id) { this.conn = this.benchmark.makeConnection(); this.conn.setAutoCommit(false); this.conn.setTransactionIsolation(this.configuration.getIsolationMode()); + DatabaseType databaseType = this.configuration.getDatabaseType(); + if ( databaseType == DatabaseType.SYBASEASE ) { + LOG.info("Running set arithabort numeric_truncation off."); + try (Statement stmt = conn.createStatement()) { + int result = stmt.executeUpdate("set arithabort numeric_truncation off"); + } catch (SQLException e) { + LOG.info(e.getMessage()); + } + } } catch (SQLException ex) { throw new RuntimeException("Failed to connect to database", ex); } diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/TPCCLoader.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/TPCCLoader.java index daaabc7b7..807ab13d9 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/TPCCLoader.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/TPCCLoader.java @@ -22,6 +22,7 @@ import com.oltpbenchmark.api.LoaderThread; import com.oltpbenchmark.benchmarks.tpcc.pojo.*; import com.oltpbenchmark.catalog.Table; +import com.oltpbenchmark.types.DatabaseType; import com.oltpbenchmark.util.SQLUtil; import java.sql.*; @@ -48,7 +49,6 @@ public TPCCLoader(TPCCBenchmark benchmark) { public List createLoaderThreads() { List threads = new ArrayList<>(); final CountDownLatch itemLatch = new CountDownLatch(1); - // ITEM // This will be invoked first and executed in a single thread. threads.add(new LoaderThread(this.benchmark) { @@ -75,7 +75,7 @@ public void load(Connection conn) { if (LOG.isDebugEnabled()) { LOG.debug("Starting to load WAREHOUSE {}", w_id); - } + } // WAREHOUSE loadWarehouse(conn, w_id); @@ -213,6 +213,7 @@ protected void loadWarehouse(Connection conn, int w_id) { // random within [0.0000 .. 0.2000] warehouse.w_tax = (TPCCUtil.randomNumber(0, 2000, benchmark.rng())) / 10000.0; + warehouse.w_name = TPCCUtil.randomStr(TPCCUtil.randomNumber(6, 10, benchmark.rng())); warehouse.w_street_1 = TPCCUtil.randomStr(TPCCUtil.randomNumber(10, 20, benchmark.rng())); warehouse.w_street_2 = TPCCUtil.randomStr(TPCCUtil.randomNumber(10, 20, benchmark.rng())); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/ycsb/YCSBBenchmark.java b/src/main/java/com/oltpbenchmark/benchmarks/ycsb/YCSBBenchmark.java index 155e087eb..cb7c184e8 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/ycsb/YCSBBenchmark.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/ycsb/YCSBBenchmark.java @@ -77,7 +77,7 @@ protected List> makeWorkersImpl() { // LOADING FROM THE DATABASE IMPORTANT INFORMATION // LIST OF USERS Table t = this.getCatalog().getTable("USERTABLE"); - String userCount = SQLUtil.getMaxColSQL(this.workConf.getDatabaseType(), t, "ycsb_key"); + String userCount = SQLUtil.getMaxColSQL(this.workConf.getDatabaseType(), t, "YCSB_KEY"); try (Connection metaConn = this.makeConnection(); Statement stmt = metaConn.createStatement(); diff --git a/src/main/java/com/oltpbenchmark/util/SQLUtil.java b/src/main/java/com/oltpbenchmark/util/SQLUtil.java index 3471dda1b..fd68ff683 100644 --- a/src/main/java/com/oltpbenchmark/util/SQLUtil.java +++ b/src/main/java/com/oltpbenchmark/util/SQLUtil.java @@ -508,7 +508,14 @@ private static AbstractCatalog getCatalogDirect(DatabaseType databaseType, Conne String separator = md.getIdentifierQuoteString(); String catalog = connection.getCatalog(); - String schema = connection.getSchema(); + String schema; + try { + schema = connection.getSchema(); + } catch (java.lang.AbstractMethodError e) { + // Sybase ASE JDBC does not implement getSchema + LOG.info("Abstract method getSchema() not implemented and will not use schema name."); + schema = null; + } Map tables = new HashMap<>(); diff --git a/src/main/resources/benchmarks/tpcc/ddl-sybasease.sql b/src/main/resources/benchmarks/tpcc/ddl-sybasease.sql new file mode 100644 index 000000000..807faf68d --- /dev/null +++ b/src/main/resources/benchmarks/tpcc/ddl-sybasease.sql @@ -0,0 +1,148 @@ +-- based from sqlserver +-- don't abort when 0.2222 is inserted into 0.22 precision +set arithabort numeric_truncation off; + +-- DROP EXISTING TABLES +if object_id('warehouse') is not null drop table warehouse; +if object_id('stock') is not null drop table stock; +if object_id('order_line') is not null drop table order_line; +if object_id('oorder') is not null drop table oorder; +if object_id('new_order') is not null drop table new_order; +if object_id('item') is not null drop table item; +if object_id('history') is not null drop table history; +if object_id('district') is not null drop table district; +if object_id('customer') is not null drop table customer; + +-- CREATE TABLES + +CREATE TABLE warehouse( + W_ID INT NOT NULL, + W_YTD DECIMAL(12, 2) NOT NULL, + W_TAX DECIMAL(4, 4) NOT NULL, + W_NAME VARCHAR(10) NOT NULL, + W_STREET_1 VARCHAR(20) NOT NULL, + W_STREET_2 VARCHAR(20) NOT NULL, + W_CITY VARCHAR(20) NOT NULL, + W_STATE CHAR(2) NOT NULL, + W_ZIP CHAR(9) NOT NULL, + PRIMARY KEY (W_ID) +); + +CREATE TABLE stock( + S_W_ID INT NOT NULL, + S_I_ID INT NOT NULL, + S_QUANTITY DECIMAL(4, 0) NOT NULL, + S_YTD DECIMAL(8, 2) NOT NULL, + S_ORDER_CNT INT NOT NULL, + S_REMOTE_CNT INT NOT NULL, + S_DATA VARCHAR(50) NOT NULL, + S_DIST_01 CHAR(24) NOT NULL, + S_DIST_02 CHAR(24) NOT NULL, + S_DIST_03 CHAR(24) NOT NULL, + S_DIST_04 CHAR(24) NOT NULL, + S_DIST_05 CHAR(24) NOT NULL, + S_DIST_06 CHAR(24) NOT NULL, + S_DIST_07 CHAR(24) NOT NULL, + S_DIST_08 CHAR(24) NOT NULL, + S_DIST_09 CHAR(24) NOT NULL, + S_DIST_10 CHAR(24) NOT NULL, + PRIMARY KEY (S_W_ID,S_I_ID) +); + +CREATE TABLE order_line( + OL_W_ID INT NOT NULL, + OL_D_ID INT NOT NULL, + OL_O_ID INT NOT NULL, + OL_NUMBER INT NOT NULL, + OL_I_ID INT NOT NULL, + OL_DELIVERY_D DATETIME NULL, + OL_AMOUNT DECIMAL(6, 2) NOT NULL, + OL_SUPPLY_W_ID INT NOT NULL, + OL_QUANTITY DECIMAL(2, 0) NOT NULL, + OL_DIST_INFO CHAR(24) NOT NULL, + PRIMARY KEY (OL_W_ID,OL_D_ID,OL_O_ID,OL_NUMBER) +); + +CREATE TABLE oorder( + O_W_ID INT NOT NULL, + O_D_ID INT NOT NULL, + O_ID INT NOT NULL, + O_C_ID INT NOT NULL, + O_CARRIER_ID INT NULL, + O_OL_CNT DECIMAL(2, 0) NOT NULL, + O_ALL_LOCAL DECIMAL(1, 0) NOT NULL, + O_ENTRY_D DATETIME NULL, + PRIMARY KEY (O_W_ID,O_D_ID,O_ID), + UNIQUE (O_W_ID,O_D_ID,O_C_ID,O_ID) +); + +CREATE TABLE new_order( + NO_W_ID INT NOT NULL, + NO_D_ID INT NOT NULL, + NO_O_ID INT NOT NULL, + PRIMARY KEY (NO_W_ID,NO_D_ID,NO_O_ID) +); + +CREATE TABLE item( + I_ID INT NOT NULL, + I_NAME VARCHAR(24) NOT NULL, + I_PRICE DECIMAL(5, 2) NOT NULL, + I_DATA VARCHAR(50) NOT NULL, + I_IM_ID INT NOT NULL, + PRIMARY KEY (I_ID) +); + +CREATE TABLE history( + H_C_ID INT NOT NULL, + H_C_D_ID INT NOT NULL, + H_C_W_ID INT NOT NULL, + H_D_ID INT NOT NULL, + H_W_ID INT NOT NULL, + H_DATE DATETIME NULL, + H_AMOUNT DECIMAL(6, 2) NOT NULL, + H_DATA VARCHAR(24) NOT NULL +); + +CREATE TABLE district( + D_W_ID INT NOT NULL, + D_ID INT NOT NULL, + D_YTD DECIMAL(12, 2) NOT NULL, + D_TAX DECIMAL(4, 4) NOT NULL, + D_NEXT_O_ID INT NOT NULL, + D_NAME VARCHAR(10) NOT NULL, + D_STREET_1 VARCHAR(20) NOT NULL, + D_STREET_2 VARCHAR(20) NOT NULL, + D_CITY VARCHAR(20) NOT NULL, + D_STATE CHAR(2) NOT NULL, + D_ZIP CHAR(9) NOT NULL, + PRIMARY KEY (D_W_ID,D_ID) +); + + +CREATE TABLE customer( + C_W_ID INT NOT NULL, + C_D_ID INT NOT NULL, + C_ID INT NOT NULL, + C_DISCOUNT DECIMAL(4, 4) NOT NULL, + C_CREDIT CHAR(2) NOT NULL, + C_LAST VARCHAR(16) NOT NULL, + C_FIRST VARCHAR(16) NOT NULL, + C_CREDIT_LIM DECIMAL(12, 2) NOT NULL, + C_BALANCE DECIMAL(12, 2) NOT NULL, + C_YTD_PAYMENT REAL NOT NULL, + C_PAYMENT_CNT INT NOT NULL, + C_DELIVERY_CNT INT NOT NULL, + C_STREET_1 VARCHAR(20) NOT NULL, + C_STREET_2 VARCHAR(20) NOT NULL, + C_CITY VARCHAR(20) NOT NULL, + C_STATE CHAR(2) NOT NULL, + C_ZIP CHAR(9) NOT NULL, + C_PHONE CHAR(16) NOT NULL, + C_SINCE DATETIME NULL, + C_MIDDLE CHAR(2) NOT NULL, + C_DATA VARCHAR(500) NOT NULL, + PRIMARY KEY (C_W_ID,C_D_ID,C_ID) +); + +-- CREATE INDEXES +CREATE INDEX IDX_CUSTOMER_NAME ON customer (C_W_ID,C_D_ID,C_LAST,C_FIRST); diff --git a/src/main/resources/benchmarks/tpcc/dialect-sybasease.xml b/src/main/resources/benchmarks/tpcc/dialect-sybasease.xml new file mode 100644 index 000000000..9e1486667 --- /dev/null +++ b/src/main/resources/benchmarks/tpcc/dialect-sybasease.xml @@ -0,0 +1,32 @@ + + + + + + SELECT TOP 1 NO_O_ID + FROM new_order + WHERE NO_D_ID = ? AND NO_W_ID = ? ORDER BY NO_O_ID ASC + + + + + SELECT D_NEXT_O_ID,D_TAX + FROM district + WHERE D_W_ID = ? AND D_ID = ? + + + SELECT S_QUANTITY, 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 stock + WHERE S_I_ID = ? AND S_W_ID = ? + + + + + SELECT TOP 1 O_ID, O_CARRIER_ID, O_ENTRY_D + FROM oorder + WHERE O_W_ID = ? AND O_D_ID = ? AND O_C_ID = ? ORDER BY O_ID DESC + + + + diff --git a/src/main/resources/benchmarks/ycsb/ddl-sybasease.sql b/src/main/resources/benchmarks/ycsb/ddl-sybasease.sql new file mode 100644 index 000000000..510524330 --- /dev/null +++ b/src/main/resources/benchmarks/ycsb/ddl-sybasease.sql @@ -0,0 +1,20 @@ +set arithabort numeric_truncation off; + +-- DROP EXISTING TABLE +if object_id('USERTABLE') is not null drop table USERTABLE; + +-- CREATE TABLE + +CREATE TABLE USERTABLE( + YCSB_KEY INT PRIMARY KEY, + FIELD1 VARCHAR(100), + FIELD2 VARCHAR(100), + FIELD3 VARCHAR(100), + FIELD4 VARCHAR(100), + FIELD5 VARCHAR(100), + FIELD6 VARCHAR(100), + FIELD7 VARCHAR(100), + FIELD8 VARCHAR(100), + FIELD9 VARCHAR(100), + FIELD10 VARCHAR(100) + ); diff --git a/src/main/resources/benchmarks/ycsb/dialect-sybasease.xml b/src/main/resources/benchmarks/ycsb/dialect-sybasease.xml new file mode 100644 index 000000000..e3994e6c5 --- /dev/null +++ b/src/main/resources/benchmarks/ycsb/dialect-sybasease.xml @@ -0,0 +1,38 @@ + + + + + + SELECT * FROM USERTABLE WHERE YCSB_KEY=? + + + + + SELECT * FROM USERTABLE WHERE YCSB_KEY > ? AND YCSB_KEY < ? + + + + + UPDATE USERTABLE SET FIELD1=?,FIELD2=?,FIELD3=?,FIELD4=?,FIELD5=?,FIELD6=?,FIELD7=?,FIELD8=?,FIELD9=?,FIELD10=? WHERE YCSB_KEY=? + + + + + INSERT INTO USERTABLE VALUES (?,?,?,?,?,?,?,?,?,?,?) + + + + + DELETE FROM USERTABLE where YCSB_KEY=? + + + + + SELECT * from USERTABLE where YCSB_KEY=? + + + UPDATE USERTABLE SET FIELD1=?,FIELD2=?,FIELD3=?,FIELD4=?,FIELD5=?,FIELD6=?,FIELD7=?,FIELD8=?,FIELD9=?,FIELD10=? WHERE YCSB_KEY=? + + + + \ No newline at end of file From a7f30c4db89e12d6ceda1ee4aff538e0fe0aeeff Mon Sep 17 00:00:00 2001 From: anasY2 Date: Tue, 26 Sep 2023 12:15:21 +0530 Subject: [PATCH 5/6] sybase-informix --- pom-arcion.xml | 517 ------------------ .../benchmarks/tpcc/TPCCLoader.java | 5 +- .../com/oltpbenchmark/types/DatabaseType.java | 4 +- .../benchmarks/tatp/ddl-sqlserver.sql | 138 ++--- .../benchmarks/tpcc/ddl-sqlserver.sql | 246 ++++----- .../benchmarks/voter/ddl-sqlserver.sql | 68 +-- .../benchmarks/ycsb/ddl-sqlserver.sql | 28 +- src/main/resources/logging.properties | 4 +- 8 files changed, 246 insertions(+), 764 deletions(-) delete mode 100644 pom-arcion.xml diff --git a/pom-arcion.xml b/pom-arcion.xml deleted file mode 100644 index 4d2e3e0d5..000000000 --- a/pom-arcion.xml +++ /dev/null @@ -1,517 +0,0 @@ - - - 4.0.0 - - - com.oltpbenchmark - benchbase - 2021-SNAPSHOT - BenchBase - BenchBase is a Multi-DBMS SQL Benchmarking Framework via JDBC https://github.com/cmu-db/benchbase - https://github.com/cmu-db/benchbase - - - UTF-8 - 17 - 17 - 17 - ${project.basedir}/target - - - src/main/assembly/tgz.xml,src/main/assembly/zip.xml - - - - - scm:git:git@github.com:cmu-db/benchbase.git - https://github.com/cmu-db/benchbase - scm:git:git@github.com:cmu-db/benchbase.git - HEAD - - - - - github - GitHub cmu-db/benchbase Apache Maven Packages - https://maven.pkg.github.com/cmu-db/benchbase - - - - - - arcion - - - jumpmind - jumpmind - https://maven.jumpmind.com/repo - - - - arcion - - - - org.xerial - sqlite-jdbc - 3.36.0.3 - - - com.ibm.db2 - jcc - 11.5.8.0 - - - org.postgresql - postgresql - 42.4.0 - - - - net.snowflake - snowflake-jdbc - 3.13.30 - - - mysql - mysql-connector-java - 8.0.29 - - - org.mariadb.jdbc - mariadb-java-client - 2.7.8 - - - com.oracle.database.jdbc - ojdbc8 - 21.1.0.0 - - - com.microsoft.sqlserver - mssql-jdbc - 11.2.3.jre17 - - - - com.ibm.informix - jdbc - 4.50.3 - - - - org.mongodb - bson - 3.8.0 - - - - jdbc.sybase - jconn4 - 16.0 - - - - - - sqlite - - sqlite - - - - org.xerial - sqlite-jdbc - 3.41.2.1 - - - - - db2 - - db2 - - - - com.ibm.db2 - jcc - 11.5.8.0 - - - - - sybase - - sybase - - - - jdbc.sybase - jconn4 - 16.0 - - - - postgres - - postgres - - - - org.postgresql - postgresql - 42.6.0 - - - - - snowflake - - snowflake - - - - - net.snowflake - snowflake-jdbc - 3.13.30 - - - - - mysql - - mysql - - - - mysql - mysql-connector-java - 8.0.30 - - - - - mariadb - - mariadb - - - - org.mariadb.jdbc - mariadb-java-client - 2.7.8 - - - - - spanner - - spanner - - - - com.google.cloud - google-cloud-spanner-jdbc - 2.9.13 - - - - - cockroachdb - - cockroachdb - - - - org.postgresql - postgresql - 42.6.0 - - - - - oracle - - oracle - - - - com.oracle.database.jdbc - ojdbc8 - 21.1.0.0 - - - - - phoenix - - phoenix - - - - org.apache.phoenix - phoenix-client-hbase-2.4 - 5.1.3 - - - - - sqlserver - - sqlserver - - - - com.microsoft.sqlserver - mssql-jdbc - 11.2.3.jre17 - - - - - informix - - informix - - - - - com.ibm.informix - jdbc - 4.50.3 - - - - org.mongodb - bson - 3.8.0 - - - - - - - - org.slf4j - slf4j-api - 2.0.7 - - - - org.slf4j - slf4j-reload4j - 2.0.7 - - - - org.apache.commons - commons-configuration2 - 2.9.0 - - - - commons-jxpath - commons-jxpath - 1.3 - - - - org.apache.commons - commons-lang3 - 3.12.0 - - - - commons-cli - commons-cli - 1.5.0 - - - - commons-io - commons-io - 2.11.0 - - - - org.apache.commons - commons-collections4 - 4.4 - - - - com.opencsv - opencsv - 5.7.1 - - - - org.json - json - 20230227 - - - - jakarta.xml.bind - jakarta.xml.bind-api - 4.0.0 - - - - org.glassfish.jaxb - jaxb-runtime - 4.0.2 - - - - org.hsqldb - hsqldb - 2.6.1 - - - - junit - junit - 4.13.2 - test - - - - - - ${buildDirectory} - - - org.apache.maven.plugins - maven-compiler-plugin - 3.11.0 - - ${maven.compiler.source} - ${maven.compiler.target} - - - - org.apache.maven.plugins - maven-jar-plugin - 3.3.0 - - ${classifier} - - - true - true - true - lib - com.oltpbenchmark.DBWorkload - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 3.5.0 - - false - ${project.artifactId}-${classifier} - false - ${descriptors} - - - - package - - single - - - - - - maven-clean-plugin - 3.2.0 - - - - results - - *.* - - false - - - - - - maven-release-plugin - 3.0.0 - - false - v@{version} - - - - pl.project13.maven - git-commit-id-plugin - 4.9.10 - - - get-the-git-infos - - revision - - initialize - - - - - true - ${project.build.outputDirectory}/git.properties - full - true - true - false - - - - org.apache.maven.plugins - maven-dependency-plugin - 3.5.0 - - - analyze - - analyze-only - - - false - - - - - - org.codehaus.mojo - exec-maven-plugin - 3.1.0 - - com.oltpbenchmark.DBWorkload - - - - - - diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/TPCCLoader.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/TPCCLoader.java index 807ab13d9..daaabc7b7 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/TPCCLoader.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/TPCCLoader.java @@ -22,7 +22,6 @@ import com.oltpbenchmark.api.LoaderThread; import com.oltpbenchmark.benchmarks.tpcc.pojo.*; import com.oltpbenchmark.catalog.Table; -import com.oltpbenchmark.types.DatabaseType; import com.oltpbenchmark.util.SQLUtil; import java.sql.*; @@ -49,6 +48,7 @@ public TPCCLoader(TPCCBenchmark benchmark) { public List createLoaderThreads() { List threads = new ArrayList<>(); final CountDownLatch itemLatch = new CountDownLatch(1); + // ITEM // This will be invoked first and executed in a single thread. threads.add(new LoaderThread(this.benchmark) { @@ -75,7 +75,7 @@ public void load(Connection conn) { if (LOG.isDebugEnabled()) { LOG.debug("Starting to load WAREHOUSE {}", w_id); - } + } // WAREHOUSE loadWarehouse(conn, w_id); @@ -213,7 +213,6 @@ protected void loadWarehouse(Connection conn, int w_id) { // random within [0.0000 .. 0.2000] warehouse.w_tax = (TPCCUtil.randomNumber(0, 2000, benchmark.rng())) / 10000.0; - warehouse.w_name = TPCCUtil.randomStr(TPCCUtil.randomNumber(6, 10, benchmark.rng())); warehouse.w_street_1 = TPCCUtil.randomStr(TPCCUtil.randomNumber(10, 20, benchmark.rng())); warehouse.w_street_2 = TPCCUtil.randomStr(TPCCUtil.randomNumber(10, 20, benchmark.rng())); diff --git a/src/main/java/com/oltpbenchmark/types/DatabaseType.java b/src/main/java/com/oltpbenchmark/types/DatabaseType.java index 5828ae6b6..a6afb8434 100644 --- a/src/main/java/com/oltpbenchmark/types/DatabaseType.java +++ b/src/main/java/com/oltpbenchmark/types/DatabaseType.java @@ -36,7 +36,7 @@ public enum DatabaseType { H2(true, false), HSQLDB(false, false), INFORMIX(false, false), - POSTGRES(false, false), + POSTGRES(false, false, true), MARIADB(true, false), MONETDB(false, false), MYROCKS(true, false), @@ -48,7 +48,7 @@ public enum DatabaseType { SPANNER(false, true), SQLAZURE(true, true, true), SQLITE(true, false), - SQLSERVER(true, false), + SQLSERVER(true, true, true), SYBASEASE(true, false), TIMESTEN(true,false), PHOENIX(true, true); diff --git a/src/main/resources/benchmarks/tatp/ddl-sqlserver.sql b/src/main/resources/benchmarks/tatp/ddl-sqlserver.sql index 6415d8f7b..27492a8ec 100644 --- a/src/main/resources/benchmarks/tatp/ddl-sqlserver.sql +++ b/src/main/resources/benchmarks/tatp/ddl-sqlserver.sql @@ -1,79 +1,79 @@ --- drop exisiting tables -if object_id('access_info') is not null drop table access_info; -if object_id('call_forwarding') is not null drop table call_forwarding; -if object_id('special_facility') is not null drop table special_facility; -if object_id('subscriber') is not null drop table subscriber; +-- Drop Exisiting Tables +IF OBJECT_ID('ACCESS_INFO') IS NOT NULL DROP table ACCESS_INFO; +IF OBJECT_ID('CALL_FORWARDING') IS NOT NULL DROP table CALL_FORWARDING; +IF OBJECT_ID('SPECIAL_FACILITY') IS NOT NULL DROP table SPECIAL_FACILITY; +IF OBJECT_ID('SUBSCRIBER') IS NOT NULL DROP table SUBSCRIBER; --- create tables +-- Create Tables -create table subscriber ( - s_id integer not null primary key, - sub_nbr varchar(15) not null unique, - bit_1 tinyint, - bit_2 tinyint, - bit_3 tinyint, - bit_4 tinyint, - bit_5 tinyint, - bit_6 tinyint, - bit_7 tinyint, - bit_8 tinyint, - bit_9 tinyint, - bit_10 tinyint, - hex_1 tinyint, - hex_2 tinyint, - hex_3 tinyint, - hex_4 tinyint, - hex_5 tinyint, - hex_6 tinyint, - hex_7 tinyint, - hex_8 tinyint, - hex_9 tinyint, - hex_10 tinyint, - byte2_1 smallint, - byte2_2 smallint, - byte2_3 smallint, - byte2_4 smallint, - byte2_5 smallint, - byte2_6 smallint, - byte2_7 smallint, - byte2_8 smallint, - byte2_9 smallint, - byte2_10 smallint, - msc_location integer, - vlr_location integer +CREATE TABLE SUBSCRIBER ( + s_id INTEGER NOT NULL PRIMARY KEY, + sub_nbr VARCHAR(15) NOT NULL UNIQUE, + bit_1 TINYINT, + bit_2 TINYINT, + bit_3 TINYINT, + bit_4 TINYINT, + bit_5 TINYINT, + bit_6 TINYINT, + bit_7 TINYINT, + bit_8 TINYINT, + bit_9 TINYINT, + bit_10 TINYINT, + hex_1 TINYINT, + hex_2 TINYINT, + hex_3 TINYINT, + hex_4 TINYINT, + hex_5 TINYINT, + hex_6 TINYINT, + hex_7 TINYINT, + hex_8 TINYINT, + hex_9 TINYINT, + hex_10 TINYINT, + byte2_1 SMALLINT, + byte2_2 SMALLINT, + byte2_3 SMALLINT, + byte2_4 SMALLINT, + byte2_5 SMALLINT, + byte2_6 SMALLINT, + byte2_7 SMALLINT, + byte2_8 SMALLINT, + byte2_9 SMALLINT, + byte2_10 SMALLINT, + msc_location INTEGER, + vlr_location INTEGER ); -create table access_info ( - s_id integer not null, - ai_type tinyint not null, - data1 smallint, - data2 smallint, - data3 varchar(3), - data4 varchar(5), - primary key(s_id, ai_type), - foreign key (s_id) references subscriber (s_id) +CREATE TABLE ACCESS_INFO ( + s_id INTEGER NOT NULL, + ai_type TINYINT NOT NULL, + data1 SMALLINT, + data2 SMALLINT, + data3 VARCHAR(3), + data4 VARCHAR(5), + PRIMARY KEY(s_id, ai_type), + FOREIGN KEY (s_id) REFERENCES SUBSCRIBER (s_id) ); -create table special_facility ( - s_id integer not null, - sf_type tinyint not null, - is_active tinyint not null, - error_cntrl smallint, - data_a smallint, - data_b varchar(5), - primary key (s_id, sf_type), - foreign key (s_id) references subscriber (s_id) +CREATE TABLE SPECIAL_FACILITY ( + s_id INTEGER NOT NULL, + sf_type TINYINT NOT NULL, + is_active TINYINT NOT NULL, + error_cntrl SMALLINT, + data_a SMALLINT, + data_b VARCHAR(5), + PRIMARY KEY (s_id, sf_type), + FOREIGN KEY (s_id) REFERENCES SUBSCRIBER (s_id) ); -create table call_forwarding ( - s_id integer not null, - sf_type tinyint not null, - start_time tinyint not null, - end_time tinyint, - numberx varchar(15), - primary key (s_id, sf_type, start_time), - foreign key (s_id, sf_type) references special_facility(s_id, sf_type) +CREATE TABLE CALL_FORWARDING ( + s_id INTEGER NOT NULL, + sf_type TINYINT NOT NULL, + start_time TINYINT NOT NULL, + end_time TINYINT, + numberx VARCHAR(15), + PRIMARY KEY (s_id, sf_type, start_time), + FOREIGN KEY (s_id, sf_type) REFERENCES SPECIAL_FACILITY(s_id, sf_type) ); --- create indexes -create index idx_cf on call_forwarding (s_id); \ No newline at end of file +-- Create Indexes +CREATE INDEX IDX_CF ON CALL_FORWARDING (S_ID); diff --git a/src/main/resources/benchmarks/tpcc/ddl-sqlserver.sql b/src/main/resources/benchmarks/tpcc/ddl-sqlserver.sql index 37af98d74..89387fd62 100644 --- a/src/main/resources/benchmarks/tpcc/ddl-sqlserver.sql +++ b/src/main/resources/benchmarks/tpcc/ddl-sqlserver.sql @@ -1,144 +1,144 @@ --- drop existing tables -if object_id('warehouse') is not null drop table warehouse; -if object_id('stock') is not null drop table stock; -if object_id('order_line') is not null drop table order_line; -if object_id('oorder') is not null drop table oorder; -if object_id('new_order') is not null drop table new_order; -if object_id('item') is not null drop table item; -if object_id('history') is not null drop table history; -if object_id('district') is not null drop table district; -if object_id('customer') is not null drop table customer; +-- DROP EXISTING TABLES +IF OBJECT_ID('WAREHOUSE') IS NOT NULL DROP TABLE WAREHOUSE; +IF OBJECT_ID('STOCK') IS NOT NULL DROP TABLE STOCK; +IF OBJECT_ID('ORDER_LINE') IS NOT NULL DROP TABLE ORDER_LINE; +IF OBJECT_ID('OORDER') IS NOT NULL DROP TABLE OORDER; +IF OBJECT_ID('NEW_ORDER') IS NOT NULL DROP TABLE NEW_ORDER; +IF OBJECT_ID('ITEM') IS NOT NULL DROP TABLE ITEM; +IF OBJECT_ID('HISTORY') IS NOT NULL DROP TABLE HISTORY; +IF OBJECT_ID('DISTRICT') IS NOT NULL DROP TABLE DISTRICT; +IF OBJECT_ID('CUSTOMER') IS NOT NULL DROP TABLE CUSTOMER; --- create tables +-- CREATE TABLES -create table [dbo].[warehouse]( - [w_id] [int] not null, - [w_ytd] [decimal](12, 2) not null, - [w_tax] [decimal](4, 4) not null, - [w_name] [varchar](10) not null, - [w_street_1] [varchar](20) not null, - [w_street_2] [varchar](20) not null, - [w_city] [varchar](20) not null, - [w_state] [char](2) not null, - [w_zip] [char](9) not null, - primary key (w_id) +CREATE TABLE [dbo].[WAREHOUSE]( + [W_ID] [INT] NOT NULL, + [W_YTD] [DECIMAL](12, 2) NOT NULL, + [W_TAX] [DECIMAL](4, 4) NOT NULL, + [W_NAME] [VARCHAR](10) NOT NULL, + [W_STREET_1] [VARCHAR](20) NOT NULL, + [W_STREET_2] [VARCHAR](20) NOT NULL, + [W_CITY] [VARCHAR](20) NOT NULL, + [W_STATE] [CHAR](2) NOT NULL, + [W_ZIP] [CHAR](9) NOT NULL, + PRIMARY KEY (W_ID) ); -create table [dbo].[stock]( - [s_w_id] [int] not null, - [s_i_id] [int] not null, - [s_quantity] [decimal](4, 0) not null, - [s_ytd] [decimal](8, 2) not null, - [s_order_cnt] [int] not null, - [s_remote_cnt] [int] not null, - [s_data] [varchar](50) not null, - [s_dist_01] [char](24) not null, - [s_dist_02] [char](24) not null, - [s_dist_03] [char](24) not null, - [s_dist_04] [char](24) not null, - [s_dist_05] [char](24) not null, - [s_dist_06] [char](24) not null, - [s_dist_07] [char](24) not null, - [s_dist_08] [char](24) not null, - [s_dist_09] [char](24) not null, - [s_dist_10] [char](24) not null, - primary key (s_w_id,s_i_id) +CREATE TABLE [dbo].[STOCK]( + [S_W_ID] [INT] NOT NULL, + [S_I_ID] [INT] NOT NULL, + [S_QUANTITY] [DECIMAL](4, 0) NOT NULL, + [S_YTD] [DECIMAL](8, 2) NOT NULL, + [S_ORDER_CNT] [INT] NOT NULL, + [S_REMOTE_CNT] [INT] NOT NULL, + [S_DATA] [VARCHAR](50) NOT NULL, + [S_DIST_01] [CHAR](24) NOT NULL, + [S_DIST_02] [CHAR](24) NOT NULL, + [S_DIST_03] [CHAR](24) NOT NULL, + [S_DIST_04] [CHAR](24) NOT NULL, + [S_DIST_05] [CHAR](24) NOT NULL, + [S_DIST_06] [CHAR](24) NOT NULL, + [S_DIST_07] [CHAR](24) NOT NULL, + [S_DIST_08] [CHAR](24) NOT NULL, + [S_DIST_09] [CHAR](24) NOT NULL, + [S_DIST_10] [CHAR](24) NOT NULL, + PRIMARY KEY (S_W_ID,S_I_ID) ); -create table [dbo].[order_line]( - [ol_w_id] [int] not null, - [ol_d_id] [int] not null, - [ol_o_id] [int] not null, - [ol_number] [int] not null, - [ol_i_id] [int] not null, - [ol_delivery_d] [datetime] null, - [ol_amount] [decimal](6, 2) not null, - [ol_supply_w_id] [int] not null, - [ol_quantity] [decimal](2, 0) not null, - [ol_dist_info] [char](24) not null, - primary key (ol_w_id,ol_d_id,ol_o_id,ol_number) +CREATE TABLE [dbo].[ORDER_LINE]( + [OL_W_ID] [INT] NOT NULL, + [OL_D_ID] [INT] NOT NULL, + [OL_O_ID] [INT] NOT NULL, + [OL_NUMBER] [INT] NOT NULL, + [OL_I_ID] [INT] NOT NULL, + [OL_DELIVERY_D] [DATETIME] NULL, + [OL_AMOUNT] [DECIMAL](6, 2) NOT NULL, + [OL_SUPPLY_W_ID] [INT] NOT NULL, + [OL_QUANTITY] [DECIMAL](2, 0) NOT NULL, + [OL_DIST_INFO] [CHAR](24) NOT NULL, + PRIMARY KEY (OL_W_ID,OL_D_ID,OL_O_ID,OL_NUMBER) ); -create table [dbo].[oorder]( - [o_w_id] [int] not null, - [o_d_id] [int] not null, - [o_id] [int] not null, - [o_c_id] [int] not null, - [o_carrier_id] [int] null, - [o_ol_cnt] [decimal](2, 0) not null, - [o_all_local] [decimal](1, 0) not null, - [o_entry_d] [datetime] null, - primary key (o_w_id,o_d_id,o_id), - unique (o_w_id,o_d_id,o_c_id,o_id) +CREATE TABLE [dbo].[OORDER]( + [O_W_ID] [INT] NOT NULL, + [O_D_ID] [INT] NOT NULL, + [O_ID] [INT] NOT NULL, + [O_C_ID] [INT] NOT NULL, + [O_CARRIER_ID] [INT] NULL, + [O_OL_CNT] [DECIMAL](2, 0) NOT NULL, + [O_ALL_LOCAL] [DECIMAL](1, 0) NOT NULL, + [O_ENTRY_D] [DATETIME] NULL, + PRIMARY KEY (O_W_ID,O_D_ID,O_ID), + UNIQUE (O_W_ID,O_D_ID,O_C_ID,O_ID) ); -create table [dbo].[new_order]( - [no_w_id] [int] not null, - [no_d_id] [int] not null, - [no_o_id] [int] not null, - primary key (no_w_id,no_d_id,no_o_id) +CREATE TABLE [dbo].[NEW_ORDER]( + [NO_W_ID] [INT] NOT NULL, + [NO_D_ID] [INT] NOT NULL, + [NO_O_ID] [INT] NOT NULL, + PRIMARY KEY (NO_W_ID,NO_D_ID,NO_O_ID) ); -create table [dbo].[item]( - [i_id] [int] not null, - [i_name] [varchar](24) not null, - [i_price] [decimal](5, 2) not null, - [i_data] [varchar](50) not null, - [i_im_id] [int] not null, - primary key (i_id) +CREATE TABLE [dbo].[ITEM]( + [I_ID] [INT] NOT NULL, + [I_NAME] [VARCHAR](24) NOT NULL, + [I_PRICE] [DECIMAL](5, 2) NOT NULL, + [I_DATA] [VARCHAR](50) NOT NULL, + [I_IM_ID] [INT] NOT NULL, + PRIMARY KEY (I_ID) ); -create table [dbo].[history]( - [h_c_id] [int] not null, - [h_c_d_id] [int] not null, - [h_c_w_id] [int] not null, - [h_d_id] [int] not null, - [h_w_id] [int] not null, - [h_date] [datetime] null, - [h_amount] [decimal](6, 2) not null, - [h_data] [varchar](24) not null +CREATE TABLE [dbo].[HISTORY]( + [H_C_ID] [INT] NOT NULL, + [H_C_D_ID] [INT] NOT NULL, + [H_C_W_ID] [INT] NOT NULL, + [H_D_ID] [INT] NOT NULL, + [H_W_ID] [INT] NOT NULL, + [H_DATE] [DATETIME] NULL, + [H_AMOUNT] [DECIMAL](6, 2) NOT NULL, + [H_DATA] [VARCHAR](24) NOT NULL ); -create table [dbo].[district]( - [d_w_id] [int] not null, - [d_id] [int] not null, - [d_ytd] [decimal](12, 2) not null, - [d_tax] [decimal](4, 4) not null, - [d_next_o_id] [int] not null, - [d_name] [varchar](10) not null, - [d_street_1] [varchar](20) not null, - [d_street_2] [varchar](20) not null, - [d_city] [varchar](20) not null, - [d_state] [char](2) not null, - [d_zip] [char](9) not null, - primary key (d_w_id,d_id) +CREATE TABLE [dbo].[DISTRICT]( + [D_W_ID] [INT] NOT NULL, + [D_ID] [INT] NOT NULL, + [D_YTD] [DECIMAL](12, 2) NOT NULL, + [D_TAX] [DECIMAL](4, 4) NOT NULL, + [D_NEXT_O_ID] [INT] NOT NULL, + [D_NAME] [VARCHAR](10) NOT NULL, + [D_STREET_1] [VARCHAR](20) NOT NULL, + [D_STREET_2] [VARCHAR](20) NOT NULL, + [D_CITY] [VARCHAR](20) NOT NULL, + [D_STATE] [CHAR](2) NOT NULL, + [D_ZIP] [CHAR](9) NOT NULL, + PRIMARY KEY (D_W_ID,D_ID) ); -create table [dbo].[customer]( - [c_w_id] [int] not null, - [c_d_id] [int] not null, - [c_id] [int] not null, - [c_discount] [decimal](4, 4) not null, - [c_credit] [char](2) not null, - [c_last] [varchar](16) not null, - [c_first] [varchar](16) not null, - [c_credit_lim] [decimal](12, 2) not null, - [c_balance] [decimal](12, 2) not null, - [c_ytd_payment] [real] not null, - [c_payment_cnt] [int] not null, - [c_delivery_cnt] [int] not null, - [c_street_1] [varchar](20) not null, - [c_street_2] [varchar](20) not null, - [c_city] [varchar](20) not null, - [c_state] [char](2) not null, - [c_zip] [char](9) not null, - [c_phone] [char](16) not null, - [c_since] [datetime] null, - [c_middle] [char](2) not null, - [c_data] [varchar](500) not null, - primary key (c_w_id,c_d_id,c_id) +CREATE TABLE [dbo].[CUSTOMER]( + [C_W_ID] [INT] NOT NULL, + [C_D_ID] [INT] NOT NULL, + [C_ID] [INT] NOT NULL, + [C_DISCOUNT] [DECIMAL](4, 4) NOT NULL, + [C_CREDIT] [CHAR](2) NOT NULL, + [C_LAST] [VARCHAR](16) NOT NULL, + [C_FIRST] [VARCHAR](16) NOT NULL, + [C_CREDIT_LIM] [DECIMAL](12, 2) NOT NULL, + [C_BALANCE] [DECIMAL](12, 2) NOT NULL, + [C_YTD_PAYMENT] [REAL] NOT NULL, + [C_PAYMENT_CNT] [INT] NOT NULL, + [C_DELIVERY_CNT] [INT] NOT NULL, + [C_STREET_1] [VARCHAR](20) NOT NULL, + [C_STREET_2] [VARCHAR](20) NOT NULL, + [C_CITY] [VARCHAR](20) NOT NULL, + [C_STATE] [CHAR](2) NOT NULL, + [C_ZIP] [CHAR](9) NOT NULL, + [C_PHONE] [CHAR](16) NOT NULL, + [C_SINCE] [DATETIME] NULL, + [C_MIDDLE] [CHAR](2) NOT NULL, + [C_DATA] [VARCHAR](500) NOT NULL, + PRIMARY KEY (C_W_ID,C_D_ID,C_ID) ); --- create indexes -create index idx_customer_name on [dbo].[customer] (c_w_id,c_d_id,c_last,c_first); +-- CREATE INDEXES +CREATE INDEX IDX_CUSTOMER_NAME ON [dbo].[CUSTOMER] (C_W_ID,C_D_ID,C_LAST,C_FIRST); diff --git a/src/main/resources/benchmarks/voter/ddl-sqlserver.sql b/src/main/resources/benchmarks/voter/ddl-sqlserver.sql index de1373860..f7edc5633 100644 --- a/src/main/resources/benchmarks/voter/ddl-sqlserver.sql +++ b/src/main/resources/benchmarks/voter/ddl-sqlserver.sql @@ -1,27 +1,27 @@ --- drop all views / tables -if object_id('v_votes_by_phone_number') is not null drop view v_votes_by_phone_number; -if object_id('v_votes_by_contestant_number_state') is not null drop view v_votes_by_contestant_number_state; -if object_id('area_code_state') is not null drop table area_code_state; -if object_id('votes') is not null drop table votes; -if object_id('contestants') is not null drop table contestants; +-- Drop all views / tables +IF OBJECT_ID('V_VOTES_BY_PHONE_NUMBER') IS NOT NULL DROP view V_VOTES_BY_PHONE_NUMBER; +IF OBJECT_ID('V_VOTES_BY_CONTESTANT_NUMBER_STATE') IS NOT NULL DROP view V_VOTES_BY_CONTESTANT_NUMBER_STATE; +IF OBJECT_ID('AREA_CODE_STATE') IS NOT NULL DROP table AREA_CODE_STATE; +IF OBJECT_ID('VOTES') IS NOT NULL DROP table VOTES; +IF OBJECT_ID('CONTESTANTS') IS NOT NULL DROP table CONTESTANTS; -- contestants table holds the contestants numbers (for voting) and names -create table contestants +CREATE TABLE CONTESTANTS ( - contestant_number integer not null -, contestant_name varchar(50) not null -, primary key + contestant_number integer NOT NULL +, contestant_name varchar(50) NOT NULL +, PRIMARY KEY ( contestant_number ) ); --- map of area codes and states for geolocation classification of incoming calls -create table area_code_state +-- Map of Area Codes and States for geolocation classification of incoming calls +CREATE TABLE AREA_CODE_STATE ( - area_code smallint not null -, state varchar(2) not null -, primary key + area_code smallint NOT NULL +, state varchar(2) NOT NULL +, PRIMARY KEY ( area_code ) @@ -29,41 +29,41 @@ create table area_code_state -- votes table holds every valid vote. -- voters are not allowed to submit more than votes, x is passed to client application -create table votes +CREATE TABLE VOTES ( - vote_id bigint not null -, phone_number bigint not null -, state varchar(2) not null -, contestant_number integer not null references contestants (contestant_number) -, created timestamp not null + vote_id bigint NOT NULL +, phone_number bigint NOT NULL +, state varchar(2) NOT NULL +, contestant_number integer NOT NULL REFERENCES CONTESTANTS (contestant_number) +, created datetime2 NOT NULL DEFAULT (CURRENT_TIMESTAMP) ); -create index idx_votes_phone_number on votes (phone_number); +CREATE INDEX idx_votes_phone_number ON VOTES (phone_number); -- rollup of votes by phone number, used to reject excessive voting -create view v_votes_by_phone_number +CREATE VIEW V_VOTES_BY_PHONE_NUMBER ( phone_number , num_votes ) -as - select phone_number - , count(*) - from votes - group by phone_number +AS + SELECT phone_number + , COUNT(*) + FROM VOTES + GROUP BY phone_number ; -- rollup of votes by contestant and state for the heat map and results -create view v_votes_by_contestant_number_state +CREATE VIEW V_VOTES_BY_CONTESTANT_NUMBER_STATE ( contestant_number , state , num_votes ) -as - select contestant_number +AS + SELECT contestant_number , state - , count(*) - from votes - group by contestant_number + , COUNT(*) + FROM VOTES + GROUP BY contestant_number , state ; diff --git a/src/main/resources/benchmarks/ycsb/ddl-sqlserver.sql b/src/main/resources/benchmarks/ycsb/ddl-sqlserver.sql index 175d2b110..180a63eaa 100644 --- a/src/main/resources/benchmarks/ycsb/ddl-sqlserver.sql +++ b/src/main/resources/benchmarks/ycsb/ddl-sqlserver.sql @@ -1,17 +1,17 @@ --- ycsb ddl for microsoft sql server +-- YCSB DDL for Microsoft SQL Server -if object_id('usertable') is not null drop table usertable; +IF OBJECT_ID('USERTABLE') IS NOT NULL DROP table USERTABLE; -create table usertable( - ycsb_key int primary key, - field1 text, - field2 text, - field3 text, - field4 text, - field5 text, - field6 text, - field7 text, - field8 text, - field9 text, - field10 text +CREATE TABLE USERTABLE( + YCSB_KEY INT PRIMARY KEY, + FIELD1 TEXT, + FIELD2 TEXT, + FIELD3 TEXT, + FIELD4 TEXT, + FIELD5 TEXT, + FIELD6 TEXT, + FIELD7 TEXT, + FIELD8 TEXT, + FIELD9 TEXT, + FIELD10 TEXT ); diff --git a/src/main/resources/logging.properties b/src/main/resources/logging.properties index 84ce1796f..c30dcb4e9 100644 --- a/src/main/resources/logging.properties +++ b/src/main/resources/logging.properties @@ -1,9 +1,9 @@ # Specify the handler, the handlers will be installed during VM startup. handlers=java.util.logging.ConsoleHandler # Default global logging level. -.level=FINEST +.level=OFF java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter java.util.logging.ConsoleHandler.level=FINEST java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %4$s %2$s %5$s%6$s%n # Facility specific properties. -org.postgresql.level=FINEST \ No newline at end of file +org.postgresql.level=FINEST From 88cca5ad0dd633eb21cfdaa8a7674bd32c1e387d Mon Sep 17 00:00:00 2001 From: anasY2 Date: Tue, 26 Sep 2023 12:56:59 +0530 Subject: [PATCH 6/6] sybasease-informix --- config/informix/sample_tpcc_config.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/informix/sample_tpcc_config.xml b/config/informix/sample_tpcc_config.xml index 962407d8d..5144bd77f 100644 --- a/config/informix/sample_tpcc_config.xml +++ b/config/informix/sample_tpcc_config.xml @@ -11,10 +11,10 @@ 128 - 4 + 1 - 2 + 1