DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Insert taking time

  1. #1
    Join Date
    Aug 2001
    Posts
    56

    Question 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

  2. #2
    Join Date
    Dec 2000
    Posts
    126
    you should have index on WCA (ALERT_TYPE)
    for WCA.ALERT_TYPE='ACT_FRD_OLF_IT'

  3. #3
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    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
  •  


Click Here to Expand Forum to Full Width