Received: from web3904.mail.yahoo.com (web3904.mail.yahoo.com [216.115.111.200]) by postgresql.org (8.11.3/8.11.4) with SMTP id f7K4QLP26687 for ; Mon, 20 Aug 2001 00:26:21 -0400 (EDT) (envelope-from trajakumar@yahoo.com) Message-ID: <20010820042620.18826.qmail@web3904.mail.yahoo.com> Received: from [203.197.179.95] by web3904.mail.yahoo.com via HTTP; Sun, 19 Aug 2001 21:26:20 PDT Date: Sun, 19 Aug 2001 21:26:20 -0700 (PDT) From: raja kumar thatte Subject: give me suggestion pl. To: pgsql-admin@postgresql.org In-Reply-To: <25409.998233758@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200108/61 X-Sequence-Number: 1997 Hai all, I have created two tables as follows CREATE TABLE AAA( ORG CHAR(4), TERM CHAR(4), ID CHAR(4), NAME VARCHAR(15) NOT NULL, DTTIME TIMESTAMP DEFAULT NOW(), ... ........ . . . 44 fields CONSTRAINT AAA PRIMARY KEY (ORG,TERM,ID), CONSTRAINT AAA_NAME_UNIQ UNIQUE (ORG,NAME), CONSTRAINT AAA_FK_OEID FOREIGN KEY(ORG) REFERENCES BBBB(ID) on delete cascade, CONSTRAINT AAA_FK_TEID FOREIGN KEY(TERM) REFERENCES BBBB(ID) on delete cascade); CREATE TABLE KKKK ( ORG CHAR(4), TERM CHAR(4), ID CHAR(4), DTTIME TIMESTAMP DEFAULT NOW(), ... ... ... 40 fields CONSTRAINT KKKK_FK FOREIGN KEY(ORG,TERM,ID) REFERENCES AAA(ORG,TERM,ID) on delete cascade, CONSTRAINT KKKK_PK PRIMARY KEY (ORG,TERM,ID,DTTIME)); The table AAA will be having 2000 records. Every 15 minutes each record will be updated. The trigger on AAA will add the new record in KKK whenever there is an update operation. So at the end of a week there will be around 5 laks records in KKKK. My problems is 'select * from KKKK' is taking a long time (more than 5 minutes ) even if KKKK is having 3 records or 5 laks records. How can i improve the performance of this select operation. Thanks raja __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/