From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Kellerer <spam_eater@gmx.net>
Cc: pgsql-general@postgresql.org
Subject: Re: Overloaded && operator from intarray module prevents index usage.
Date: Thu, 28 Feb 2019 11:44:50 -0500
Message-ID: <10517.1551372290@sss.pgh.pa.us> (raw)
In-Reply-To: <q583lv$5t8m$1@blaine.gmane.org>
References: <q583lv$5t8m$1@blaine.gmane.org>
Thomas Kellerer <spam_eater@gmx.net> writes:
> While testing a query on an integer array with a GIN index, I stumbled over a behaviour which surprised me and which I would consider a bug - but maybe I am wrong.
It's not a bug --- the problem is that that operator is capturing your
query reference, and it's not a member of the opclass for the index
you have, so no index scan for you.
> The above happens even if the intarray extension is a the end of the search path, e.g. "set search_path = public, intarray".
Yeah, because it's an exact datatype match while the core operator
is anyarray && anyarray which is not.
Ideally, perhaps, the extension could add its operator to the core
gin-arrays opclass, but we lack any reasonable way to manage that.
Something that's maybe more likely to happen is to remove that
operator from the extension altogether; but that will break things
for some people too, no doubt :-(
regards, tom lane
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-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, spam_eater@gmx.net
Subject: Re: Overloaded && operator from intarray module prevents index usage.
In-Reply-To: <10517.1551372290@sss.pgh.pa.us>
References: <q583lv$5t8m$1@blaine.gmane.org> <10517.1551372290@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