In an embodiment, a problem record associated with a query is saved to a
log if the query encountered a problem. The amount of data in the record
is increased if an access plan associated with the query has changed
within a threshold amount of time and decreased if the access plan has
not changed. In various embodiments, the problem is that the query
executes longer than a historical average for the query, the query
executes longer than a threshold, or the query encounters a functional
error. In an embodiment, a benchmark record is also saved to the log, the
problem record is compared to the benchmark record, and the difference is
presented. In various embodiments, an oldest record is periodically
removed from the log, or an oldest record is removed from the log if the
associated query has more than a threshold number of records.