Skip to content
This repository was archived by the owner on Aug 23, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions config/sample_chbench_nuodb_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?xml version="1.0"?>
<parameters>

<!-- Connection details -->
<dbtype>nuodb</dbtype>
<driver>com.nuodb.jdbc.Driver</driver>
<DBUrl>jdbc:com.nuodb://arrakis/chbenchmark</DBUrl>
<DBName>chbenchmark</DBName>
<username>dba</username>
<password>dba</password>
<!-- isolation>TRANSACTION_SERIALIZABLE</isolation -->
<isolation>TRANSACTION_READ_COMMITTED</isolation>

<!-- Scale factor is the number of warehouses in TPCC -->
<scalefactor>2</scalefactor>

<!-- The workload -->
<!-- Workload-specific options a marked with @bench=[workload_name] -->
<!-- Workload-specific number of terminals -->
<!-- Number of terminal per workload -->
<terminals bench="chbenchmark">1</terminals>
<terminals bench="tpcc">4</terminals>

<works>
<work>
<warmup>10</warmup>
<time>60</time>
<rate bench="chbenchmark">unlimited</rate>
<rate bench="tpcc">unlimited</rate>
<!-- NOTE: TPCC workers won't be distributed evenly between warehouses
if not all workers are active -->
<active_terminals bench="tpcc">4</active_terminals>
<active_terminals bench="chbenchmark">1</active_terminals>
<weights bench="chbenchmark">9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8</weights>
<weights bench="tpcc">45,43,4,4,4</weights>
</work>
</works>

<!-- TPCC specific -->
<transactiontypes bench="tpcc">
<transactiontype>
<name>NewOrder</name>
</transactiontype>
<transactiontype>
<name>Payment</name>
</transactiontype>
<transactiontype>
<name>OrderStatus</name>
</transactiontype>
<transactiontype>
<name>Delivery</name>
</transactiontype>
<transactiontype>
<name>StockLevel</name>
</transactiontype>
</transactiontypes>

<!-- TPCH specific w/some Qs removed for performance reasons -->
<transactiontypes bench="chbenchmark">
<transactiontype>
<name>Q1</name>
</transactiontype>
<transactiontype>
<name>Q2</name>
</transactiontype>
<transactiontype>
<name>Q3</name>
</transactiontype>
<transactiontype>
<name>Q4</name>
</transactiontype>
<transactiontype>
<name>Q6</name>
</transactiontype>
<transactiontype>
<name>Q11</name>
</transactiontype>
<transactiontype>
<name>Q12</name>
</transactiontype>
<transactiontype>
<name>Q13</name>
</transactiontype>
<transactiontype>
<name>Q14</name>
</transactiontype>
<transactiontype>
<name>Q17</name>
</transactiontype>
<transactiontype>
<name>Q18</name>
</transactiontype>
<transactiontype>
<name>Q19</name>
</transactiontype>
</transactiontypes>

</parameters>
13 changes: 12 additions & 1 deletion src/com/oltpbenchmark/api/BenchmarkModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}

// --------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
16 changes: 16 additions & 0 deletions src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query15.sql
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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;
Original file line number Diff line number Diff line change
Expand Up @@ -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
ORDER BY revenue DESC , o_entry_d;

Original file line number Diff line number Diff line change
Expand Up @@ -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
ORDER BY o_ol_cnt;
Original file line number Diff line number Diff line change
Expand Up @@ -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
AND ol_quantity BETWEEN 1 AND 100000;
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ GROUP BY su_nationkey,
l_year
ORDER BY su_nationkey,
cust_nation,
l_year
l_year;