Primary and Foreign Keys Necessity for TPC-H Benchmark

benchmarkdatabase-designdatabase-recommendation

I'm doing some tests with tpc-h benchmark. The tpch-h benchmark simulates a data warehouse environment. The most important things here are the queries against the data warehouse. Therefore, does it make sense to create primary and foreign keys for this benchmark? I read some articles that do that, but I don't understand why it's necessary.

Best Answer

The specification TPC BENCHMARKTM H, Standard Specification, Revision 2.17.1, can be found here. See section "1. LOGICAL DATABASE DESIGN / 1.5 IMPLEMENTATION RULES". Indexes can be created on combinations of fields defined in 1.4.2.2 and 1.4.2.3 and on date fields. Indexes may only contain fields of one table. So indexes can be built on the following fields:

  • Table PART:

    • P_PARTKEY
  • Table SUPPLIER:

    • S_SUPPKEY
  • Table PARTSUPP:

    • PS_PARTKEY
    • PS_SUPPKEY
  • Table CUSTOMER:

    • C_CUSTKEY
    • C_NATIONKEY
  • Table ORDERS:

    • O_ORDERKEY
    • O_CUSTKEY
    • O_ORDERDATE
  • Table REGION:

    • R_REGIONKEY
  • Table LINEITEM:

    • L_LINENUMBER
    • L_ORDERKEY
    • L_PARTKEY
    • L_SUPPKEY
    • L_SHIPDATE
    • L_COMMITDATE
    • L_RECEIPTDATE
  • Table NATION:

    • N_NATIONKEY
    • N_REGIONKEY