Check your counters
by Stéphane Faroult
But I must admit that counters, whether you call them identity or auto-increment columns, or simply sequences, are extremely valuable for relating the techy's to the bean counter's vision of activity. In most applications, there is at least one such counter that represents fairly acurately the business activity - whether it is an increasing order number, invoice number, transaction identifier or whatever. Rather than execute complex queries with conditions on date columns to collect those so precious "key performance indicators", it may be easier to check the data dictionary, look for sequences or identity columns, and take a daily (or anything) snapshot of the current highest values, together with statistics about the number of executed statements and whatever your DBMS has to offer.
Suppose the new release of an application increases the number of wasted keys--for instance, order numbers allocated for orders not completed due to failures of the application. How does your measure (number of order numbers allocated) relate to the the business result (number of orders completed)? How does it differentiate between that and a day of bad phone lines into a call center?