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/