5. Checking the Schema

From v4.10 a schema and data check has been added that can be run after a schema build and also after running a workload with a refresh function to ensure that the data remains consistent. To run the check select the Check option from the treeview or the main menu.

Figure 12.18. Check TPROC-H Schema

Check TPROC-H Schema

When completed a message will be shown if the check was successful.

Figure 12.19. TPROC-H Schema Check Completed

TPROC-H Schema Check Completed

The following checks will be run against the schema and data:

  1. Database Exists.

  2. Tables Exist.

  3. Scale Factor in schema is the same as the HammerDB configuration.

  4. Tables are indexed.

  5. Tables are populated.

  6. Consistency Check.

    1. A consistent state for the TPC-H database is defined to exist when: O_TOTALPRICE = SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT)(1+L_TAX) for each ORDER and LINEITEM defined by (O_ORDERKEY=L_ORDERKEY) and can be checked by: SELECT DECIMAL(SUM(DECIMAL(INTEGER(INTEGER(DECIMAL (INTEGER(100DECIMAL(L_EXTENDEDPRICE,20,3)),20,3)* (1-L_DISCOUNT)) * (1+L_TAX)),20,3)/100.0),20,3) FROM LINEITEM WHERE L_ORDERKEY = okey SELECT DECIMAL(SUM(O_TOTALPRICE, 20, 3)) from ORDERS WHERE O_ORDERKEY = okey