pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: Overloaded && operator from intarray module prevents index usage.
Date: Thu, 28 Feb 2019 11:22:33 +0100
Message-ID: <95eb0be2-6020-3197-ecdb-8850f691ffa5@gmx.net> (raw)
In-Reply-To: <87ef7se0q3.fsf@news-spur.riddles.org.uk>
References: <q583lv$5t8m$1@blaine.gmane.org>
	<87ef7se0q3.fsf@news-spur.riddles.org.uk>

Andrew Gierth schrieb am 28.02.2019 um 10:29:
> [intarray woes]
> 
>  Thomas> Is this expected behaviour? Is this caused by the Postgres core
>  Thomas> (e.g. the optimizer to taking the opclass into account) or is
>  Thomas> it a "problem" in the way the intarray module defines its
>  Thomas> operators?
> 
> It's basically a conflict between intarray (which is historically older)
> and the built-in array indexing support.
> 
> The reason it happens is that the operator resolution logic matches an
> (integer[] && integer[]) operator in preference to (anyarray && anyarray)
> regardless of their relative position on the search_path. This
> resolution happens before anything is known about any indexes that might
> be applicable. Then later, at planning time, an index is chosen based on
> the operator, not the reverse.

That makes sense, thanks. 





view thread (15+ messages)  latest in thread

Message-ID: <95eb0be2-6020-3197-ecdb-8850f691ffa5@gmx.net>
Permalink:  ../95eb0be2-6020-3197-ecdb-8850f691ffa5@gmx.net/
Also on:    postgresql.org/message-id/95eb0be2-6020-3197-ecdb-8850f691ffa5@gmx.net

 · 

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-general@postgresql.org
  Cc: spam_eater@gmx.net
  Subject: Re: Overloaded && operator from intarray module prevents index usage.
  In-Reply-To: <95eb0be2-6020-3197-ecdb-8850f691ffa5@gmx.net>
  References: <q583lv$5t8m$1@blaine.gmane.org> <87ef7se0q3.fsf@news-spur.riddles.org.uk> <95eb0be2-6020-3197-ecdb-8850f691ffa5@gmx.net>

* 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