5. Checking the Schema

From v4.10 a new schema check option has been added. This schema check can be run after the build process to verify that the build completed successfully and also after running the workload to ensure that the data in your database remained consistent. This can also be useful for example when testing clustered, distributed or replicated database environments.

To check the schema choose the Check option from the treeview or the top level menu.

Figure 4.14. Check TPROC-C Schema

Check TPROC-C Schema

If the check completes without error it will report a message that the check has been successful meaning that the schema is valid and the data is consistent.

Figure 4.15. TPROC-C Schema Check Complete

TPROC-C Schema Check Complete

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

  1. Database Exists.

  2. Tables Exist.

  3. Warehouse count in schema is the same as the HammerDB configuration.

  4. Tables are indexed.

  5. Tables are populated.

  6. Stored Procedures Exist.

  7. Consistency Checks.

    1. The sum of balances (d_ytd) for all Districts within a specific Warehouse is equal to the balance (w_ytd) of that Warehouse.

    2. For each District within a Warehouse, the next available Order ID (d_next_o_id) minus one is equal to the most recent Order ID [max(o_id)] for the ORDER table associated with the preceding District and Warehouse. Additionally, that same relationship exists for the most recent Order ID [max(o_id)] for the NEW-ORDER table associated with the same District and Warehouse. Those relationships can be illustrated as: d_next_o_id – 1 = max(o_id) = max(no_o_id) where (d_w_id = o_w_id = no_w_id) and (d_id = o_d_id = no_d_id)

    3. For each District within a Warehouse, the value of the most recent Order ID [max(no_o_id)] minus the first Order ID [min(no_o_id)] plus one, for the NEW-ORDER table associated with the District and Warehouse, equals the number of rows in that NEW-ORDER table. That relationship can be illustrated as: max(no_o_id) – min(no_o_id) + 1 = rows in NEW-ORDER where (o_w_id = no_w_id) and (o_d_id = no_d_id)

    4. For each District within a Warehouse, the sum of Order-Line counts [sum(o_ol_cnt)] for the Orders associated with the District equals the number of rows in the ORDER-LINE table associated with the same District. That relationship can be illustrated as: sum(o_ol_cnt) = rows in the ORDER-LINE table for the Warehouse and District