Results 1 to 3 of 3
  1. #1
    Join Date
    May 2012
    Posts
    3

    Unanswered: Query running slow. pls Optimize

    selectsum(ch.compensation_value),
    ch.dealer_id_int_pay,
    de.lastname,
    k.total_volume
    from(selectsum(chm.compensation_value)astotal_volu me,
    chm.dealer_id_int_pay
    from
    compensation_history chm ,
    dealerdem,
    contractconm
    --lookup_product_entry_01 ttm
    where
    chm.contract_id=conm.contract_id(+)
    andchm.currency_id= 0
    andchm.client_id= 1
    andchm.bill_id> 0
    andchm.dealer_id_int_pay= 4082283 --1004481
    andchm.dcs_run_idbetween 1001912 and 1001935
    anddem.dealer_id_int=chm.dealer_id_int_pay
    andttm.attribute_entry_id = conm.event_type
    --and ttm.attribute_entry_char_id in ('AK','AKM')
    --and ttm.attribute_entry_char_id in ('AK','UP', 'AKM', 'VV', 'UPB' ,'VOT'
    -- alternatively I use the following command:
    andconm.event_type in (1 ,4 ,100, 150, 300, 1144, 1204, 1320,5016,301 )This command extends the execution time. Is there a possibility to speed up the execution with another solution?
    groupbychm.dealer_id_int_pay
    is this inline view necessary or could it be solved in another way?
    ) k,

    dcs_compensation_historych,
    --contract_infocinf ,
    dealer de
    -- contract con
    -- lookup_product_entry_01tt

    --where con.contract_id = cinf.contract_id
    wherek.dealer_id_int_pay=ch.dealer_id_int_pay
    andch.contract_idin(selectdistinctci.contract_id
    fromstd_contract_info ci where ci.contract_attribute_14 in('MV','RV')) it can be solve by equi join but it is not time critical
    --and cinf.contract_attribute_14 in ( 'MV','RV')
    --and ch.contract_id = cinf.contract_id
    andch.dcs_run_idbetween 1001912 and 1001935
    andch.client_id= 1
    andch.bill_id> 0
    andch.dealer_id_int_pay= 4082283 --1004481
    andde.dealer_id_int=ch.dealer_id_int_pay
    --and tt.attribute_entry_id = con.event_type
    --and tt.attribute_entry_char_id in ('AK','AKM')
    andcon.contract_id = ch.contract_id
    andcon.event_type in (1 ,4 ,100, 150, 300, 1144, 1204, 1320,5016,301 ) very slowly how to change that
    andch.currency_id= 0
    groupbych.dealer_id_int_pay,
    de.lastname,k.total_volume;


    --and ttm.attribute_entry_char_id in ('AK','UP', 'AKM', 'VV', 'UPB' ,'VOT' ,'UPO','VTO', 'UPI')
    andconm.event_typein(1 ,4 ,100, 150, 300, 1144, 1204, 1320,5016 )
    groupbychm.dealer_id_int_pay;

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Why post garbage & ask for help to clean up this mess?

    Any code posted here should be 100% correct & valid syntax.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Please see the following link on formatting your code.

    http://www.dbforums.com/oracle/10316...ml#post3802453
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •