Robert Haas <robertmhaas@xxxxxxxxx> writes: > Shouldn't there be a separate estimator for scalarlesel? Or should > the existing estimator be adjusted to handle the two cases > differently? Well, it does handle it differently to some extent, in that the operator itself is invoked when checking the MCV values, so we get the right answer for those. The fact that there's not separate estimators for < and <= is something we inherited from Berkeley, so I can't give the original rationale for certain, but I think the notion was that the difference is imperceptible when dealing with a continuous distribution. The question is whether you think that the "=" case contributes any significant amount to the probability given that the bound is not one of the MCV values. (If it is, the MCV check will have accounted for it, so adding anything would be wrong.) I guess we could add 1/ndistinct or something like that, but I'm not convinced that will really make the estimates better, mainly because ndistinct is none too reliable itself. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance