1. For use in a computer database system, a method for compressing a workload used by an application and including a plurality of statements comprising: providing a distance function for pairs of statements within a workload which returns an estimate of the loss in quality for an application if a first statement is discarded from the workload but a second statement of the pair of statements is retained in a compressed workload; and finding a compressed workload W′ by evaluating the distance function for pairs of statements to produce a compressed workload having fewer statements than an initial workload W.