On 1/27/25 16:50, Alexander Korotkov wrote:
> I expressed my point on this in [1]. We generally greedy about index
> quals and there is no logic which prevent us from using a clause and
> index qual because of its cost. And there are many cases when this
> causes regressions before d4378c0005. One of examples from [1].
Ok,
Generally, I don't concern myself with the evaluation of individual
subplans. As you mentioned, it should be a rare occurrence when this
becomes important. My main concern is the shift in frequency of
evaluations during execution for various reasons.
For example:
qsort(matches, n, sizeof(OrArgIndexMatch), or_arg_index_match_cmp);
To fit an index, the order of elements in the target array of the
`ScalarArrayOpExpr` may change compared to the initial list of OR
expressions. If there are indexes that cover the same set of columns but
in reverse order, this could potentially alter the position of a
Subplan. However, I believe this is a rare case; it is supported by the
initial OR path and should be acceptable.
So, I do not have any further objections at this time.
--
regards, Andrei Lepikhov