pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Quan Zongliang <quanzongliang@yeah.net>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Bug: When user-defined AM is used, the index path cannot be selected correctly
Date: Tue, 16 Aug 2022 22:03:53 -0400
Message-ID: <1606486.1660701833@sss.pgh.pa.us> (raw)
In-Reply-To: <f293b91d-1d46-d386-b6bb-4b06ff5c667b@yeah.net>
References: <f293b91d-1d46-d386-b6bb-4b06ff5c667b@yeah.net>

Quan Zongliang <quanzongliang@yeah.net> writes:
> 1. When using extended PGroonga
> ...
> 3. Neither ID = 'f' nor id= 't' can use the index correctly.

This works fine for btree indexes.  I think the actual problem
is that IsBooleanOpfamily only accepts the btree and hash
opclasses, and that's what needs to be improved.  Your proposed
patch fails to do that, which makes it just a crude hack that
solves some aspects of the issue (and probably breaks other
things).

It might work to change IsBooleanOpfamily so that it checks to
see whether BooleanEqualOperator is a member of the opclass.
That's basically what we need to know before we dare generate
substitute index clauses.  It's kind of an expensive test
though, and the existing coding assumes that IsBooleanOpfamily
is cheap ...

			regards, tom lane





view thread (5+ messages)  latest in thread

Message-ID: <1606486.1660701833@sss.pgh.pa.us>
Permalink:  ../1606486.1660701833@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1606486.1660701833@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, quanzongliang@yeah.net
  Subject: Re: Bug: When user-defined AM is used, the index path cannot be selected correctly
  In-Reply-To: <1606486.1660701833@sss.pgh.pa.us>
  References: <f293b91d-1d46-d386-b6bb-4b06ff5c667b@yeah.net> <1606486.1660701833@sss.pgh.pa.us>

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

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