Re: Overloaded && operator from intarray module prevents index usage. - Mailing list pgsql-general

From Tom Lane
Subject Re: Overloaded && operator from intarray module prevents index usage.
Date
Msg-id 10517.1551372290@sss.pgh.pa.us
Whole thread Raw
In response to Overloaded && operator from intarray module prevents index usage.  (Thomas Kellerer <spam_eater@gmx.net>)
Responses Re: Overloaded && operator from intarray module prevents index usage.
List pgsql-general
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
Iwould 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


pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: automated refresh of dev from prod
Next
From: Raymond Brinzer
Date:
Subject: Re: Where **not** to use PostgreSQL?