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

Thread: Different Query time

  1. #1
    Join Date
    Dec 2002
    Posts
    89

    Different Query time

    I have a view with following code in it

    create view test_t as
    SELECT TRUNC(DY_DAY) SALE_DATE, FM_POWER_KEY,TO_POWER_KEY,HO_HOUR,MIN(NVL(FMPVH_ACT_VOLUME,0)) PURCH,
    (MIN(NVL(TOPVH_ACT_VOLUME,0)) + SUM(LOSS_VOLUME)) SALES FROM sams.act_purchase_vol
    HAVING MIN(NVL(FMPVH_ACT_VOLUME,0)) != (MIN(NVL(TOPVH_ACT_VOLUME,0)) + SUM(LOSS_VOLUME))
    GROUP BY DY_DAY,FM_POWER_KEY,TO_POWER_KEY,HO_HOUR


    if i ran query from above view

    select * from test_t where day >= '01-mar-2005'

    rows return within 30 sec.

    if i ran with
    select * from test_t where day = '01-mar-2005'
    then it just runs

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    trace the query, compare the execution plans

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