pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Neil Conway <neilc@samurai.com>
To: Steven Butler <stevenb@kjross.com.au>
Cc: pgsql-performance@postgresql.org
Subject: Re: Using bigint needs explicit cast to use the index
Date: Sun, 07 Mar 2004 19:43:58 -0500
Message-ID: <404BC1CE.3040009@samurai.com> (raw)
In-Reply-To: <001101c404a3$fb34d320$fd08a8c0@steve>
References: <001101c404a3$fb34d320$fd08a8c0@steve>

Steven Butler wrote:
> I've recently converted a database to use bigint for the indices.  Suddenly
> simple queries like
> 
> select * from new_test_result where parent_id = 2
> 
> are doing full table scans instead of using the index.

This is fixed in CVS HEAD. In the mean time, you can enclose the 
integer literal in single quotes, or explicitely cast it to the type 
of the column.

FWIW, this is an FAQ.

-Neil



view thread (6+ messages)  latest in thread

Message-ID: <404BC1CE.3040009@samurai.com>
Permalink:  ../404BC1CE.3040009@samurai.com/
Also on:    postgresql.org/message-id/404BC1CE.3040009@samurai.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: neilc@samurai.com, stevenb@kjross.com.au
  Subject: Re: Using bigint needs explicit cast to use the index
  In-Reply-To: <404BC1CE.3040009@samurai.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