pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: gnari <gnari@simnet.is>
To: Cao Duy <cao.duy@1und1.com>
To: pgsql-performance@postgresql.org
Subject: Re: simple select-statement takes more than 25 sec
Date: Wed, 10 Nov 2004 10:31:40 -0000
Message-ID: <000501c4c710$774bb170$0100000a@wp2000> (raw)
References: <1100079350.3980.18.camel@Knoppix>

From: "Cao Duy" <cao.duy@1und1.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





view thread (5+ messages)  latest in thread

Message-ID: <000501c4c710$774bb170$0100000a@wp2000>
Permalink:  ../000501c4c710$774bb170$0100000a@wp2000/
Also on:    postgresql.org/message-id/000501c4c710$774bb170$0100000a@wp2000

 · 

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: gnari@simnet.is, cao.duy@1und1.com
  Subject: Re: simple select-statement takes more than 25 sec
  In-Reply-To: <000501c4c710$774bb170$0100000a@wp2000>

* 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