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 EFB7D3A3C77 for ; Wed, 10 Nov 2004 11:22:29 +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 06957-04 for ; Wed, 10 Nov 2004 11:22:22 +0000 (GMT) Received: from dom3.intranet.online.de (intranet.online.de [212.227.34.162]) by svr1.postgresql.org (Postfix) with ESMTP id 46E223A3BCA for ; Wed, 10 Nov 2004 11:22:23 +0000 (GMT) Received: from [10.0.40.48] ([10.0.40.48]) by dom3.intranet.online.de (Lotus Domino Release 5.0.11) with ESMTP id 2004111012271036:120022 ; Wed, 10 Nov 2004 12:27:10 +0100 Subject: Re: simple select-statement takes more than 25 sec From: Cao Duy To: pgsql-performance@postgresql.org In-Reply-To: <20041110101747.GB22780@uio.no> References: <1100079350.3980.18.camel@Knoppix> <20041110101747.GB22780@uio.no> Message-Id: <1100085737.3980.43.camel@Knoppix> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Wed, 10 Nov 2004 12:22:17 +0100 X-MIMETrack: Itemize by SMTP Server on DOMINO3/1&1/DE(Release 5.0.11 |July 24, 2002) at 10.11.2004 12:27:10, Serialize by Router on DOMINO3/1&1/DE(Release 5.0.11 |July 24, 2002) at 10.11.2004 12:27:13, Serialize complete at 10.11.2004 12:27:13 Content-Transfer-Encoding: 7bit Content-Type: text/plain 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/167 X-Sequence-Number: 9121 Am Mi, den 10.11.2004 schrieb Steinar H. Gunderson um 11:17: > On Wed, Nov 10, 2004 at 10:35:50AM +0100, Cao Duy wrote: > > here is my simple select-statement: > > SELECT * FROM CUSTOMER WHERE CUSTOMER_ID=5 > > It seems like you're missing an index on customer_id. Set it to PRIMARY KEY > or do an explicit CREATE INDEX (followed by an ANALYZE) and it should be a > lot faster. there is an index on customer_id create table customer( ... CONSTRAINT customer_pkey PRIMARY KEY (customer_id), ... ) > /* Steinar */