Hi All,
I am having a difficult time optimizing a procedure to run more effeiently, and am hoping that someone may give some advise...
Basically, I have 2 tables:
-- Raw (staging table, max 50,000 records)
-- Lookup (over 200 million records and growing)
I have a package developed to import data from a text file into the Raw Table.. From there I have to perform updates on the Raw table to mark records as valid or not.
The raw table contains about 100 fields, of which 3 columns are used...
If data in any of these 3 columns matches any record from Lookup table, then the record in Raw Table must be updated...Lookup table is huge!
It is easy to write a simple update statement which will work, however I find the processing time is far too long!!
Below is the code from within procedure:
Update Raw
Set Col9=1000,
Col10='Invalid'
from Raw a, Lookup b
where (a.Col1 = b.Col2 or
a.Col2 = b.Col2 or
a.Col3 = b.Col2)
Does anyone have any tips on how to optimize?
Thanks in advance
oobern81
I am having a difficult time optimizing a procedure to run more effeiently, and am hoping that someone may give some advise...
Basically, I have 2 tables:
-- Raw (staging table, max 50,000 records)
-- Lookup (over 200 million records and growing)
I have a package developed to import data from a text file into the Raw Table.. From there I have to perform updates on the Raw table to mark records as valid or not.
The raw table contains about 100 fields, of which 3 columns are used...
If data in any of these 3 columns matches any record from Lookup table, then the record in Raw Table must be updated...Lookup table is huge!
It is easy to write a simple update statement which will work, however I find the processing time is far too long!!
Below is the code from within procedure:
Update Raw
Set Col9=1000,
Col10='Invalid'
from Raw a, Lookup b
where (a.Col1 = b.Col2 or
a.Col2 = b.Col2 or
a.Col3 = b.Col2)
Does anyone have any tips on how to optimize?
Thanks in advance
oobern81