On Wed, Oct 14, 2026 at 10:25 AM Tom Lane <[email protected]> wrote:
> This is related to one of the bugs I fixed in b28a2b2bf, but I think
> it's different.  I fear your patch might be too sweeping though ---
> are you sure it doesn't reject cases that would be valid?  I'd prefer
> to inject the no-nextPos test on a per-node-type basis.

Yes, you're right. Seems we can safely extract an index condition if
the combined effect of the items following a predicate cannot turn false
or unknown predicate result into true. For example,
"($ == 1).string().lower().boolean()" can still use its index condition.

So I've updated the patch to check the entire chain of items following
a predicate. It allows chains that are safe as a whole and conservatively
skips extraction otherwise.

I've identified 13 such item types so far, but of course I may have
missed some. Thoughts?

Regards,

-- 
Fujii Masao

Attachment: v2-0001-Fix-GIN-jsonpath-index-conditions-for-predicates-.patch
Description: Binary data

Reply via email to