Re: Optimizer failure on integer column? - Mailing list pgsql-general

From Jonathan Bartlett
Subject Re: Optimizer failure on integer column?
Date
Msg-id Pine.GSU.4.44.0306100721040.2398-100000@eskimo.com
Whole thread Raw
In response to Re: Optimizer failure on integer column?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Is it an int8 column?  If it is, you have to cast all raw numbers to
int8, or the optimizer won't catch that it can use the index.

For example, in perl

$dbh->prepare("select * from mytable where myinteger = ?::int8");

will be able to use the optimizer.

Jon

On Fri, 6 Jun 2003, Tom Lane wrote:

> nolan@celery.tssi.com writes:
> > Is there a documented problem with optimizing integer key fields
> > in 7.3.3?
>
> No.  How about providing some more details, like EXPLAIN ANALYZE
> output?  The given query plan looks reasonable if the planner's
> estimates are right ... but since you're complaining, I'd imagine
> they are not.  (Also, I assume you've done an ANALYZE lately?)
>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: The transaction that "happens" with function invocation
Next
From: Jonathan Bartlett
Date:
Subject: Re: Pg_dumpall