1. A computer-implemented method comprising: obtaining, by a testing system comprising one or more computers, a plurality of query plans generated by a plurality of respective query optimizers, each query plan of the plurality of query plans being alternative query plans for computing results for a query; computing, for each query plan of the plurality of query plans, a respective estimated cost to compute results for the query using the query plan; executing each query plan of the plurality of query plans to compute a respective actual cost of executing the query plan; performing a clustering algorithm on the plurality of query plans using the respective estimated cost and respective actual cost to classify each query plan as belonging to a cluster or as being an outlier; computing, for each query optimizer from query plans generated by the optimizer, a respective rank correlation score, including: selecting, by the testing system, no more than N different query plans generated by the query optimizer, including selecting at least one outlier according to the clustering algorithm; generating, by the testing system, (i) a first ranking of query plans generated by the query optimizer, ordered according to the respective actual cost of each query plan generated by the query optimizer, and (ii) a second ranking of query plans generated by the query optimizer, ordered according to the respective estimated cost of each query plan generated by the query optimizer; computing, by the testing system based at least on the first ranking of the different query plans and the second ranking of the different query plans, a first rank correlation score indicative of an accuracy of the query optimizer in estimating costs associated with executing query plans, wherein determining the first rank correlation score comprises performing a pair-wise comparison of each pair of plans that were incorrectly ranked in the second ranking, including iteratively: computing a weight of each particular plan, the weight representing a comparison of an actual cost of a highest-ranked plan to an actual cost for the particular plan, weighting a distance between each pair of incorrectly ranked plans according to a first weight for a first plan and a second weight for a second plan, and adding the weighted distance for the pair of plans to the first rank correlation score for the query optimizer; ranking the plurality of query optimizers according to the respective rank correlation score computed for each of the plurality of query optimizers; and improving performance of a database system, including selecting, by the testing system, as a preferred query optimizer for generating query plans for the database system, a highest-ranked query optimizer according to the ranking of the plurality of query optimizers.