-
Insert taking time
Hi I have a concern here, I am trying to insert records using bulk method
here is the query
INSERT INTO WELLS_CC_GLOBAL_RULE_FRD_AP
(RULE_ID,
CHAMPION,
CHALLENGER,
ALERT_ID,
SSN,
AMOUNT,
ALERT_TYPE,
ALERT_DATE)
SELECT WCR.RULE_ID ,
decode(champion,1,'Y','N') as champion,
decode(challenger,1,'Y','N') as challenger,
WCA.Alert_id,
WCA.SSN,
WCA.Amount,
WCA.Alert_Type,
WCA.Alert_date
FROM wells_challenger_Alerts WCA,Wells_CC_reporting WCR
WHERE WCA.alert_id=WCR.alert_id
AND WCA.ALERT_TYPE='ACT_FRD_OLF_IT'
AND WCA.ALERT_DATE>= '03-FEB-09' AND WCA.ALERT_DATE< '11-MAY-09'
INdex in WCA tables column (Alert_idm Alert_type)
and WCR table (alert_id)
when I see execution plan in Toad, its use Hash_join and both table full scan.
Execution time of query is 290 msec, but when insert takes 5 sec. I need to reduce the time. Anybody can help/suggest
Regards
Anuj
Anuj
India
-
you should have index on WCA (ALERT_TYPE)
for WCA.ALERT_TYPE='ACT_FRD_OLF_IT'
-
How about cardinality?
How many rows in each table?
How many rows get selected for insert?
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|