Re: 7.3.1 New install, large queries are slow - Mailing list pgsql-performance

From Jeff
Subject Re: 7.3.1 New install, large queries are slow
Date
Msg-id Pine.BSF.4.44.0301170858080.55072-100000@torgo.978.org
Whole thread Raw
In response to Re: 7.3.1 New install, large queries are slow  ("Roman Fail" <rfail@posportal.com>)
Responses Re: 7.3.1 New install, large queries are slow
Re: 7.3.1 New install, large queries are slow
List pgsql-performance
On Thu, 16 Jan 2003, Roman Fail wrote:

>
> HOWEVER.....look at this:
> EXPLAIN ANALYZE select batchdetailid from batchdetail where batchdetailid = 27321::bigint;
>  Index Scan using batchdetail_pkey on batchdetail  (cost=0.00..4.13 rows=1 width=8) (actual time=0.03..0.03 rows=1
loops=1)
>    Index Cond: (batchdetailid = 27321::bigint)
>  Total runtime: 0.07 msec
>

We had this happen to us - we had a serial8 column (int8) and our query
was straight forward where id = 12345; which ran craptacularly.  After
much head banging and cursing I had tried where id = '12345' and it
magically worked. I think the parser is interpreting a "number" to be an
int4 instead of int8.  (instead of quotes you can also cast via
12345::int8 like you did)

Perhaps this should go on the TODO - when one side is an int8 and the
other is a literal number assume the number to be int8 instead of int4?

------------------------------------------------------------------------------
Jeff Trout <jeff@jefftrout.com>                  http://www.jefftrout.com/
   Ronald McDonald, with the help of cheese soup,
       controls America from a secret volkswagon hidden in the past
-------------------------------------------------------------------------------



pgsql-performance by date:

Previous
From: "Charles H. Woloszynski"
Date:
Subject: Re: 7.3.1 New install, large queries are slow
Next
From: "Roman Fail"
Date:
Subject: Implicit casting and JOIN syntax constraints