[2.2] Flush the plan cache when counts have changed a lot

We flush the plan cache whenever we think that the changes to the counts have been greater than a threshold