Benchmarks

The bench/ directory hosts example programs, micro-benchmarks, and development utilities built on top of ORQ.

Sub-directories:

  • queries/ – End-to-end analytical queries and demonstrations.

    • tpch/ - TPC-H queries

    • secretflow/ - comparisons with SecretFlow

    • other/ - all other queries from competitors

  • micro/ – Small micro-benchmarks targeting specific primitives.

For more information on the queries, see the C++ source files. Below, documentation for the data-generation classes is provided.

TPCH Database Generator.

Reference: Ch. 1 of the TPC-H Specification, https://www.tpc.org/TPC_Documents_Current_Versions/pdf/TPC-H_v3.0.1.pdf

Naming semantics:

  • Table names are all capitalized

  • Column names should use PascalCase

  • Column names should not use table prefixes, unless required for disambiguation in a query. In that case, a single-character table identifer can be prepended, with an underscore (e.g., O_Comment)

Defines

CUSTOMERS_MULTIPLIER
ORDERS_MULTIPLIER
PART_MULTIPLIER
SUPPLIER_MULTIPLIER
PARTSUPP_MULTIPLIER
NATION_SIZE
REGION_SIZE
PARTSUPP_PER_PART
CUSTOMER_ORDER_FRACTION
COMMENT_BITS
TPCH_DATE_THRESHOLD
TPCH_DATE_INTERVAL
TPCH_DISCOUNT_THRESHOLD
TPCH_QUANTITY_THRESHOLD
template<typename T = int>
class TPCDatabase
#include <tpch_dbgen.h>

Public Functions

inline TPCDatabase(double sf)
inline TPCDatabase(double sf, sqlite3 *sqlite_db)
inline size_t customersSize()
inline size_t ordersSize()
inline size_t lineitemsSize()
inline size_t partSize()
inline size_t partSuppSize()
inline size_t supplierSize()
inline size_t nationSize()
inline size_t regionSize()
inline EncodedTable<T> getCustomersTable()
inline EncodedTable<T> getLineitemTable(bool proactive_sharing = false)

Get the Lineitem Table object.

Parameters:

proactive_sharing – whether to use proactive sharing: also return in the table secret-shared values with constant thresholds subtracted off already.

Returns:

EncodedTable<T>

inline EncodedTable<T> getOrdersTable()
inline EncodedTable<T> getRegionTable()
inline EncodedTable<T> getNationTable()
inline EncodedTable<T> getPartTable()
inline EncodedTable<T> getSupplierTable()
inline EncodedTable<T> getPartSuppTable()
inline EncodedTable<T> getLineitemTableSecretFlow(int num_rows)

Get the Lineitem Table object with the SecretFlow SCQL data distribution.

Returns:

EncodedTable<T>

inline EncodedTable<T> getPartTableSecretFlow(int num_rows)
inline EncodedTable<T> getOrdersTableSecretFlow(int num_rows)

Public Members

const double scaleFactor
sqlite3 *sqlite_db
size_t lineItemsSize = 0

Protected Functions

inline Vector<T> randomColumn(size_t size, T min_val, T max_val)

Generate a random vector of type T (possibly signed) from [min_val, max_val).

Parameters:
  • size

  • min_val – the minimum value (inclusive)

  • max_val – the maximum value (exclusive)

Returns:

Vector<T>

inline Vector<T> counterColumn(size_t size)

Generate a counter column, suitable for primary keys, etc. Will count from 0 to size - 1.

Parameters:

size

Returns:

Vector<T>

Defines

SECRECY_R_SIZE
SECRECY_S_SIZE
SECRECY_T1_SIZE
SECRECY_T2_SIZE
SECRECY_T3_SIZE
DIAGNOSIS_SIZE
MEDICATION_SIZE
STANDARD_SIZE
template<typename T = int>
class SecrecyDatabase : public TPCDatabase<int>
#include <secrecy_dbgen.h>

Public Functions

inline SecrecyDatabase(double sf)
inline SecrecyDatabase(double sf, sqlite3 *sqlite_db)
inline size_t secrecyRSize()
inline size_t secrecySSize()
inline size_t secrecyT1Size()
inline size_t secrecyT2Size()
inline size_t secrecyT3Size()
inline EncodedTable<T> getSecrecyRTable()
inline EncodedTable<T> getSecrecySTable()
inline EncodedTable<T> getDiagnosisTable()
inline EncodedTable<T> getMedicationTable()
inline EncodedTable<T> getPasswordTable()
inline EncodedTable<T> getTaxiTable()
inline EncodedTable<T> getSecrecyT1Table()
inline EncodedTable<T> getSecrecyT2Table()
inline EncodedTable<T> getSecrecyT3Table()
inline EncodedTable<T> getCreditScoreTable()

Public Members

const size_t MAX_TIME = 10000
const int N_DISEASE = 100
const int N_DISEASE_CLASS = 16
const int MAX_COST = 10000