X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C46C13A3D36 for ; Wed, 10 Nov 2004 10:29:25 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 88218-07 for ; Wed, 10 Nov 2004 10:29:17 +0000 (GMT) Received: from quasar.skima.is (quasar.skima.is [212.30.200.205]) by svr1.postgresql.org (Postfix) with ESMTP id 01CA63A3CB0 for ; Wed, 10 Nov 2004 10:29:17 +0000 (GMT) Received: from wp2000 ([157.157.160.157] [157.157.160.157]) by quasar.skima.is; Wed, 10 Nov 2004 10:29:14 Z Message-Id: <000501c4c710$774bb170$0100000a@wp2000> From: "gnari" To: "Cao Duy" , References: <1100079350.3980.18.camel@Knoppix> Subject: Re: simple select-statement takes more than 25 sec Date: Wed, 10 Nov 2004 10:31:40 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200411/166 X-Sequence-Number: 9120 From: "Cao Duy" > > 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