From: Cao Duy <cao.duy@1und1.com>
To: pgsql-performance@postgresql.org
Subject: simple select-statement takes more than 25 sec
Date: Wed, 10 Nov 2004 10:35:50 +0100
Message-ID: <1100079350.3980.18.camel@Knoppix> (raw)
Hi all
I have a table with ca. 4Mio Rows.
here is my simple select-statement:
SELECT * FROM CUSTOMER WHERE CUSTOMER_ID=5
the result appears after about 27 sec.
what's wrong?
the same statement on mysql takes 1 milisec.
please help
here is the structur of the table
CREATE TABLE public.customer
(
customer_id bigserial NOT NULL,
cooperationpartner_id int8 NOT NULL DEFAULT 0::bigint,
maincontact_id int8 NOT NULL DEFAULT 0::bigint,
companycontact_id int8,
def_paymentdetails_id int8,
def_paymentsort_id int8,
def_invoicing_id int8,
int_customernumber varchar(50),
ext_customernumber varchar(50),
CONSTRAINT customer_pkey PRIMARY KEY (customer_id),
CONSTRAINT customer_ibfk_1 FOREIGN KEY (cooperationpartner_id)
REFERENCES public.cooperationpartner (cooperationpartner_id) ON UPDATE
NO ACTION ON DELETE NO ACTION,
CONSTRAINT customer_ibfk_2 FOREIGN KEY (maincontact_id) REFERENCES
public.contact (contact_id) ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT customer_ibfk_3 FOREIGN KEY (companycontact_id) REFERENCES
public.contact (contact_id) ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT customer_ibfk_4 FOREIGN KEY (def_paymentdetails_id)
REFERENCES public.paymentdetails (paymentdetails_id) ON UPDATE NO ACTION
ON DELETE NO ACTION,
CONSTRAINT customer_ibfk_5 FOREIGN KEY (def_paymentsort_id) REFERENCES
public.paymentsort (paymentsort_id) ON UPDATE NO ACTION ON DELETE NO
ACTION,
CONSTRAINT customer_ibfk_6 FOREIGN KEY (def_invoicing_id) REFERENCES
public.invoicing (invoicing_id) ON UPDATE NO ACTION ON DELETE NO ACTION
) WITH OIDS;
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: cao.duy@1und1.com
Subject: Re: simple select-statement takes more than 25 sec
In-Reply-To: <1100079350.3980.18.camel@Knoppix>
* 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