pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: joris.vandyck@promani.be
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14087: btree_gin index doesn't work on INT with POSITIVE constraint
Date: Fri, 15 Apr 2016 17:09:16 -0400
Message-ID: <30984.1460754556@sss.pgh.pa.us> (raw)
In-Reply-To: <20160415185902.22924.77993@wrigleys.postgresql.org>
References: <20160415185902.22924.77993@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

joris.vandyck@promani.be writes:
> It seems like the choice between using the full index (first case with
> integer) or using the index partly and then filtering manually (second case
> with smallint) should not depend on whether the random_id is defined as
> integer or smallint.

The reason for the plan change is that if "random_id" is smallint, then
"random_id > 11422" is a cross-type operator (int2 > int4), and btree_gin
lacks support for such operators.  Fixing that is probably just a Small
Matter Of Programming, but I doubt it's very high on anyone's to-do list.
In the meantime, you might consider casting the comparison constant to
int2 explicitly if you want to make "random_id" be smallint; that is,
"random_id > 11422::smallint" would be indexable.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <30984.1460754556@sss.pgh.pa.us>
Permalink:  ../30984.1460754556@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/30984.1460754556@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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, joris.vandyck@promani.be
  Subject: Re: BUG #14087: btree_gin index doesn't work on INT with POSITIVE constraint
  In-Reply-To: <30984.1460754556@sss.pgh.pa.us>
  References: <20160415185902.22924.77993@wrigleys.postgresql.org> <30984.1460754556@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