From: Jeff Frost <jeff@pgexperts.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6092: specific casting required for gist indexing of bigint
Date: Wed, 06 Jul 2011 10:14:41 -0700
Message-ID: <4E149801.40507@pgexperts.com> (raw)
In-Reply-To: <2786.1309910771@sss.pgh.pa.us>
References: <201107052343.p65NhoKD055167@wwwmaster.postgresql.org>
<2786.1309910771@sss.pgh.pa.us>
On 07/05/11 17:06, Tom Lane wrote:
> "Jeff Frost" <jeff@pgexperts.com> writes:
>> Ran into a situation with a customer who is using the btree_gist contrib
>> module to allow combined index of some tsearch data and two other columns.
>> One of these other columns is a bigint field. I noticed that the combined
>> index won't be used by the planner unless you specifically cast the bare
>> number to a bigint.
> If memory serves, the btree_gist opclasses don't include any cross-type
> operators, so "int8 = int4" doesn't work here.
>
Ah! And if you look at the contrib/btree_gist/sql/int8.sql test file, you'll
see this:
SELECT count(*) FROM int8tmp WHERE a < 464571291354841::int8;
So, I'd say it's expected behavior even though it's slightly counter intuitive
if you're used to the auto typing behavior.
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: jeff@pgexperts.com, tgl@sss.pgh.pa.us
Subject: Re: BUG #6092: specific casting required for gist indexing of bigint
In-Reply-To: <4E149801.40507@pgexperts.com>
References: <201107052343.p65NhoKD055167@wwwmaster.postgresql.org> <2786.1309910771@sss.pgh.pa.us> <4E149801.40507@pgexperts.com>
* 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