Re: simple select-statement takes more than 25 sec

From: "gnari" <gnari(at)simnet(dot)is>
To: "Cao Duy" <cao(dot)duy(at)1und1(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: simple select-statement takes more than 25 sec
Date: 2004-11-10 10:31:40
Message-ID: 000501c4c710$774bb170$0100000a@wp2000
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

From: "Cao Duy" <cao(dot)duy(at)1und1(dot)com>
>
> here is my simple select-statement:
> SELECT * FROM CUSTOMER WHERE CUSTOMER_ID=5
>
> the result appears after about 27 sec.
>
> what's wrong?
> ...
> CREATE TABLE public.customer
> (
> customer_id bigserial NOT NULL,

you do not specify version or show us
an explain analyze, or tell us what indexes
you have, but if you want to use an index
on the bigint column customer_id, and you
are using postgres version 7.4 or less, you
need to cast your constant (5) to bigint.

try
SELECT * FROM CUSTOMER WHERE CUSTOMER_ID=5::bigint
or
SELECT * FROM CUSTOMER WHERE CUSTOMER_ID='5'

gnari

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Cao Duy 2004-11-10 11:22:17 Re: simple select-statement takes more than 25 sec
Previous Message Steinar H. Gunderson 2004-11-10 10:17:47 Re: simple select-statement takes more than 25 sec