public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tomas Vondra <[email protected]>
To: Arseniy Mukhin <[email protected]>
To: Álvaro Herrera <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: amcheck support for BRIN indexes
Date: Tue, 8 Jul 2025 15:21:04 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAE7r3MJeqDSfic9pQedsRg3xg49q7=iq5PTuZNNNi7yqAw8dTw@mail.gmail.com>
References: <[email protected]>
	<[email protected]>
	<CAE7r3MJeqDSfic9pQedsRg3xg49q7=iq5PTuZNNNi7yqAw8dTw@mail.gmail.com>



On 7/8/25 14:40, Arseniy Mukhin wrote:
> On Mon, Jul 7, 2025 at 3:21 PM Álvaro Herrera <[email protected]> wrote:
>>
>> On 2025-Jul-07, Tomas Vondra wrote:
>>
>>> Alvaro, what's your opinion on the introduction of the new WITHIN_RANGE?
>>> I'd probably try to do this using the regular consistent function:
>>>
>>> (a) we don't need to add stuff to all BRIN opclasses to support this
>>>
>>> (b) it gives us additional testing of the consistent function
>>>
>>> (c) building a scan key for equality seems pretty trivial
>>>
>>> What do you think?
>>
>> Oh yeah, if we can build this on top of the existing primitives, then
>> I'm all for that.
> 
> Thank you for the feedback! I agree with the benefits. Speaking of
> (с), it seems most of the time to be really trivial to build such a
> ScanKey, but not every opclass supports '=' operator. amcheck should
> handle these cases somehow then. I see two options here. The first is
> to not provide  'heap all indexed' check for such opclasses, which is
> sad because even one core opclass (box_inclusion_ops) doesn't support
> '=' operator, postgis brin opclasses don't support it too AFAICS. The
> second option is to let the user define which operator to use during
> the check, which, I think, makes user experience much worse in this
> case. So both options look not good from the user POV as for me, so I
> don't know. What do you think about it?
> 
> And should I revert the patchset to the consistent function version then?
> 

Yeah, that's a good point. The various opclasses may support different
operators, and we don't know which "strategy" to fill into the scan key.
Minmax needs BTEqualStrategyNumber, inclusion RTContainsStrategyNumber,
and so on.

I wonder if there's a way to figure this out from the catalogs, but I
can't think of anything. Maybe requiring the user to supply the operator
(and not checking heap if it's not provided)

  SELECT brin_index_check(..., '@>');

would not be too bad ...


Alvaro, any ideas?


-- 
Tomas Vondra






reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: amcheck support for BRIN indexes
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox