diff --git a/config/sample_chbench_nuodb_config.xml b/config/sample_chbench_nuodb_config.xml new file mode 100644 index 000000000..0d075922b --- /dev/null +++ b/config/sample_chbench_nuodb_config.xml @@ -0,0 +1,98 @@ + + + + + nuodb + com.nuodb.jdbc.Driver + jdbc:com.nuodb://arrakis/chbenchmark + chbenchmark + dba + dba + + TRANSACTION_READ_COMMITTED + + + 2 + + + + + + 1 + 4 + + + + 10 + + unlimited + unlimited + + 4 + 1 + 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8 + 45,43,4,4,4 + + + + + + + NewOrder + + + Payment + + + OrderStatus + + + Delivery + + + StockLevel + + + + + + + Q1 + + + Q2 + + + Q3 + + + Q4 + + + Q6 + + + Q11 + + + Q12 + + + Q13 + + + Q14 + + + Q17 + + + Q18 + + + Q19 + + + + diff --git a/src/com/oltpbenchmark/api/BenchmarkModule.java b/src/com/oltpbenchmark/api/BenchmarkModule.java index f48818178..712d7b874 100644 --- a/src/com/oltpbenchmark/api/BenchmarkModule.java +++ b/src/com/oltpbenchmark/api/BenchmarkModule.java @@ -30,6 +30,7 @@ import java.util.Map; import java.util.Random; import java.util.Set; +import java.util.Properties; import org.apache.log4j.Logger; @@ -110,13 +111,23 @@ public BenchmarkModule(String benchmarkName, WorkloadConfiguration workConf, boo * @return * @throws SQLException */ - public final Connection makeConnection() throws SQLException { + /*public final Connection makeConnection() throws SQLException { Connection conn = DriverManager.getConnection( workConf.getDBConnection(), workConf.getDBUsername(), workConf.getDBPassword()); Catalog.setSeparator(conn); return (conn); + }*/ + public final Connection makeConnection() throws SQLException { + Properties properties = new Properties(); + properties.put("user", workConf.getDBUsername()); + properties.put("password", workConf.getDBPassword()); + if(workConf.getDBName() != null) properties.put("schema", workConf.getDBName()); + + Connection conn = DriverManager.getConnection(workConf.getDBConnection(),properties); + Catalog.setSeparator(conn); + return (conn); } // -------------------------------------------------------------------------- diff --git a/src/com/oltpbenchmark/benchmarks/chbenchmark/ddls/chbenchmark-nuodb-ddl.sql b/src/com/oltpbenchmark/benchmarks/chbenchmark/ddls/chbenchmark-nuodb-ddl.sql index fb16af46b..6101a2c10 100644 --- a/src/com/oltpbenchmark/benchmarks/chbenchmark/ddls/chbenchmark-nuodb-ddl.sql +++ b/src/com/oltpbenchmark/benchmarks/chbenchmark/ddls/chbenchmark-nuodb-ddl.sql @@ -1,6 +1,6 @@ -DROP TABLE IF EXISTS region CASCADE; -DROP TABLE IF EXISTS nation CASCADE; DROP TABLE IF EXISTS supplier CASCADE; +DROP TABLE IF EXISTS nation CASCADE; +DROP TABLE IF EXISTS region CASCADE; create table region ( r_regionkey int not null, diff --git a/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query15.sql b/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query15.sql index bb07d27a9..d9d507c4e 100644 --- a/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query15.sql +++ b/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query15.sql @@ -1,3 +1,17 @@ +CREATE view revenue0 (supplier_no, total_revenue) AS +SELECT +mod((s_w_id * s_i_id),10000) as supplier_no, +sum(ol_amount) as total_revenue +FROM +order_line, stock +WHERE +ol_i_id = s_i_id +AND ol_supply_w_id = s_w_id +AND ol_delivery_d >= '2007-01-02 00:00:00.000000' +GROUP BY +supplier_no; + + SELECT su_suppkey, su_name, su_address, @@ -7,3 +21,5 @@ FROM supplier, revenue0 WHERE su_suppkey = supplier_no AND total_revenue = (select max(total_revenue) from revenue0) ORDER BY su_suppkey; + +DROP VIEW revenue0; diff --git a/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query3.sql b/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query3.sql index ce8b8fd2d..7bd954118 100644 --- a/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query3.sql +++ b/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query3.sql @@ -22,4 +22,5 @@ GROUP BY ol_o_id, ol_w_id, ol_d_id, o_entry_d -ORDER BY revenue DESC , o_entry_d \ No newline at end of file +ORDER BY revenue DESC , o_entry_d; + diff --git a/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query4.sql b/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query4.sql index 931775ef6..7990b0f98 100644 --- a/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query4.sql +++ b/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query4.sql @@ -9,4 +9,4 @@ WHERE exists AND o_d_id = ol_d_id AND ol_delivery_d >= o_entry_d) GROUP BY o_ol_cnt -ORDER BY o_ol_cnt \ No newline at end of file +ORDER BY o_ol_cnt; diff --git a/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query6.sql b/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query6.sql index a366c2dd6..f51640e04 100644 --- a/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query6.sql +++ b/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query6.sql @@ -2,4 +2,4 @@ SELECT sum(ol_amount) AS revenue FROM order_line WHERE ol_delivery_d >= '1999-01-01 00:00:00.000000' AND ol_delivery_d < '2020-01-01 00:00:00.000000' - AND ol_quantity BETWEEN 1 AND 100000 \ No newline at end of file + AND ol_quantity BETWEEN 1 AND 100000; diff --git a/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query7.sql b/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query7.sql index 2e07caed6..e5f1cffce 100644 --- a/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query7.sql +++ b/src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query7.sql @@ -30,4 +30,4 @@ GROUP BY su_nationkey, l_year ORDER BY su_nationkey, cust_nation, - l_year \ No newline at end of file + l_year;