I have migrated (using OMWB) some of the tables from an Access 97 application to Oracle 8i and am now trying to get it to run quicker. The application when completely in A97 took between 30 and 40 minutes to run, now with two of the larger tables in Oracle it is taking 160 to 200 minutes. This time difference is due really to two particular queries which append data from 'temporary' tables in Access to the Oracle tables. These appends involve about 300,000 records and are currently taking just over 60 minutes each compared to less than 2 minutes when appending to an Access backend. Since the Oracle tables only contain 5 weeks worth of data so far it seems that it's only going to take even longer when I put the 2 years worth of data into them.
The move to Oracle is a definite requirement since we need to store over 2 years of data at a time, c.31 million records. Within Access this involves dividing the backend database into 5 seperate databases.
Has anyone out there got any advice on how to speed the processing of the two append queries, the SQL for them is given below.
INSERT INTO PolicyPremium ( Year_no, Week_no, System_Type, Policy_no, Agent_no, Kind_Code, Version, Product_type, Status, Premium, Freq, Cobe, Add_Con, Commence_Date )
SELECT DISTINCT DPOLICY.Year_no, DPOLICY.Week_no, "DUB" AS Expr1, DPOLICY.POL_NUMBER, DPOLICY.AGENT_NUMB, CobeType.Kind_Code, CobeType.Version, CobeType.Product_Type, StatusCodes.Indicator, DPOLICY.ANNUAL_P, DPOLICY.FREQUENCY, DPOLICY.COBE, DPOLICY.ADDL_CONT AS Add_Con, DPOLICY.COMMENCE_DATE
FROM (DPOLICY LEFT JOIN CobeType ON DPOLICY.COBE = CobeType.COBE) LEFT JOIN StatusCodes ON DPOLICY.STATUS = StatusCodes.Code
WHERE ((DPOLICY.Year_no=[Year?]) AND (DPOLICY.Week_no=[Week?]));
INSERT INTO Max_Archive
SELECT Max.*
FROM Max;
The move to Oracle is a definite requirement since we need to store over 2 years of data at a time, c.31 million records. Within Access this involves dividing the backend database into 5 seperate databases.
Has anyone out there got any advice on how to speed the processing of the two append queries, the SQL for them is given below.
INSERT INTO PolicyPremium ( Year_no, Week_no, System_Type, Policy_no, Agent_no, Kind_Code, Version, Product_type, Status, Premium, Freq, Cobe, Add_Con, Commence_Date )
SELECT DISTINCT DPOLICY.Year_no, DPOLICY.Week_no, "DUB" AS Expr1, DPOLICY.POL_NUMBER, DPOLICY.AGENT_NUMB, CobeType.Kind_Code, CobeType.Version, CobeType.Product_Type, StatusCodes.Indicator, DPOLICY.ANNUAL_P, DPOLICY.FREQUENCY, DPOLICY.COBE, DPOLICY.ADDL_CONT AS Add_Con, DPOLICY.COMMENCE_DATE
FROM (DPOLICY LEFT JOIN CobeType ON DPOLICY.COBE = CobeType.COBE) LEFT JOIN StatusCodes ON DPOLICY.STATUS = StatusCodes.Code
WHERE ((DPOLICY.Year_no=[Year?]) AND (DPOLICY.Week_no=[Week?]));
INSERT INTO Max_Archive
SELECT Max.*
FROM Max;