Order creation throughput

For example, in Oracle, to calculate the rate at which orders were created on a specific date (e.g., July 4, 2011), you can issue the following query:

   select substr(order_header_key,1,10) time, count(*) as count
   from yfs_order_header 
   where order_header_key > '20110704000000' and
         order_header_key < '20110704999999'
   group by substr(order_header_key,1,10);
   

This query produces a listing like this:

   TIME                          COUNT 
   ------------------------ ----------
   2011070406                     3333
   2011070407                     3366
   2011070408                     3333
   
Note: For DB2®, you should issue throughput queries as uncommitted reads. By default, queries run at the cursor stability level. As a result, DB2 has to obtain a read share lock on the record it is reading. Queries against tables with high insert or update activities block behind records with update or exclusive locks.

For DB2 to issue the query above at the uncommitted read lock level, issue the query with the "WITH UR" option:

   select substr(order_header_key,1,10) time, count(*) as count
   from yfs_order_header 
   where order_header_key > '20110704000000' and
         order_header_key < '20110704999999'
   group by substr(order_header_key,1,10)
   with UR;