Re: [PATCH] Add support function for containment operators - Mailing list pgsql-hackers

From Kim Johan Andersson
Subject Re: [PATCH] Add support function for containment operators
Date
Msg-id 4cdc292e-3234-a03d-107d-31cf8b721cd4@kimmet.dk
Whole thread Raw
In response to Re: [PATCH] Add support function for containment operators  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: [PATCH] Add support function for containment operators
List pgsql-hackers
On 07-07-2023 13:20, Laurenz Albe wrote:
> I wrote:
>> You implement both "SupportRequestIndexCondition" and "SupportRequestSimplify",
>> but when I experimented, the former was never called.  That does not
>> surprise me, since any expression of the shape "expr <@ range constant"
>> can be simplified.  Is the "SupportRequestIndexCondition" branch dead code?
>> If not, do you have an example that triggers it?

I would think it is dead code, I came to the same conclusion. So we can 
drop SupportRequestIndexCondition, since the simplification happens to 
take care of everything.


> I had an idea about this:
> So far, you only consider constant ranges.  But if we have a STABLE range
> expression, you could use an index scan for "expr <@ range", for example
> Index Cond (expr >= lower(range) AND expr < upper(range)).
> 

I will try to look into this. Originally that was what I was hoping for, 
but didn't see way of going about it.

Thanks for your comments, I will also look at the locale-related 
breakage you spotted.

    Regards,
        Kimjand



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [Patch] Use *other* indexes on the subscriber when REPLICA IDENTITY is FULL
Next
From: Alena Rybakina
Date:
Subject: Re: Problems with estimating OR conditions, IS NULL on LEFT JOINs