Rod Taylor <rbt(at)zort(dot)ca> writes:
>> In that case, this code is worse than before as far as developing plans
>> goes. The selectivity estimator needs to be taught about what BETWEEN
>> means. Currently it recognizes (x > foo AND x < bar) as a range query
>> --- a BETWEEN node is obviously much easier to recognize, but you still
>> have to add code to do it.
> I simply multiple the results of the left, right and common expression
> after sending them through clause_selectivity() ?
Huh? I don't see any "common expression" here. You've got a left
comparison and a right comparison.
Actually, at least for the case of the standard asymmetric BETWEEN
clause, you really really want to be able to generate a bounded
indexscan plan (indexscan with x > foo AND x < bar as indexquals).
That used to happen for free, and now will not happen at all, because
BETWEEN is not in the set of operators recognized as indexscannable
operators. Not sure what the most appropriate fix is --- there are a
number of places that we could try to fix it at, with varying
implications as to the amount of code changed and the generality of
the cases handled.
regards, tom lane
In response to
pgsql-patches by date
|Next:||From: Joe Conway||Date: 2002-07-18 22:00:21|
|Subject: small psql patch - show Schema name for \dt \dv \dS|
|Previous:||From: Bruce Momjian||Date: 2002-07-18 20:36:56|
|Subject: Re: Fix for regression caused by heap tuple header changes|