give me suggestion pl.

From: raja kumar thatte <trajakumar(at)yahoo(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: give me suggestion pl.
Date: 2001-08-20 04:26:20
Message-ID: 20010820042620.18826.qmail@web3904.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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/

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message John Turner 2001-08-20 13:13:26 Re: upgrading RPM query
Previous Message Grant 2001-08-20 01:52:35 Re: [SQL] deleting large objects from jdbc