The present invention is directed towards a diagnostic system for a database
system. The diagnostic system includes a grouping module for assigning a grouping
identifier to each query received by the database system; and a statistics collection
module. The statistics collection module includes a query processing statistics
module for obtaining processing statistics corresponding to each query; a group
statistics compilation module for compiling processing statistics for each query
by the query's grouping identifier; and group data storage for storing compiled
processing statistics. A method is also disclosed for generating database diagnostic data.