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

Thread: query run slow -bad query

  1. #1
    Join Date
    Aug 2002
    Location
    Atlanta
    Posts
    1,187

    query run slow -bad query

    I created an index on a table as a result turned out to be hero just destroying the run time of some processes to next to nothing.

    Now that index is whacking another query. Where previously the query ran in seconds it takes 10 mins as it uses the new index as opposed to a FFS. All stats are current.

    Funnt thing is with the inded the cost is lower for the problem query yet it still runs like a dog.

    Gory details attached.

    Any ideas?
    Attached Files Attached Files
    I'm stmontgo and I approve of this message

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439

    Re: query run slow -bad query

    Originally posted by stmontgo
    All stats are current.
    Are you sure? What about the histograms of the columns included in the new index? Is their distribution squewed?

    And btw, that Webfocus things appears to be oe of those incredible products where their developers never heard of the concept called "bind variables"....
    Last edited by jmodic; 11-18-2004 at 02:11 PM.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  3. #3
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    I worked with PeopleSoft (HR/PAYROLL) application. PS_JOB is very important table. If you add new index or drop existing index, then you need to test the whole application. Be careful.

    PHP Code:

    SELECT T1
    ."EMPLID"T1."COMPANY"T1."EMPL_STATUS",T1."NAME",   
           
    T1."ETHNIC_GROUP",T1."GRADE",T2."ROWSECCLASS"
    FROM   SYSADM.PS_EMPLOYEES  T1,
           
    SYSADM.PS_PERS_SRCH_QRY T2
    WHERE 
    (T2."EMPLID" T1."EMPLID")
      AND (
    T1."EMPL_STATUS" IN('A''L''P''S'))
      AND (
    T1."COMPANY" '096')
      AND (
    T2."ROWSECCLASS" 'DPALL'
    If I am not mistaken, PS_PERS_SRCH_QRY is a view. Can you post the view definition.

    Tamil

  4. #4
    Join Date
    Aug 2002
    Location
    Atlanta
    Posts
    1,187
    Originally posted by tamilselvan
    I worked with PeopleSoft (HR/PAYROLL) application. PS_JOB is very important table. If you add new index or drop existing index, then you need to test the whole application. Be careful.

    PHP Code:

    SELECT T1
    ."EMPLID"T1."COMPANY"T1."EMPL_STATUS",T1."NAME",   
           
    T1."ETHNIC_GROUP",T1."GRADE",T2."ROWSECCLASS"
    FROM   SYSADM.PS_EMPLOYEES  T1,
           
    SYSADM.PS_PERS_SRCH_QRY T2
    WHERE 
    (T2."EMPLID" T1."EMPLID")
      AND (
    T1."EMPL_STATUS" IN('A''L''P''S'))
      AND (
    T1."COMPANY" '096')
      AND (
    T2."ROWSECCLASS" 'DPALL'
    If I am not mistaken, PS_PERS_SRCH_QRY is a view. Can you post the view definition.

    Tamil
    far be it from me to make a mistake but...

    We are using gather stale stats and having looked at a smallish table from the PS_PERS_SRCH_QRY view I could see that stats were last genereated two months ago. Once I generated stats on that table the query is back in business.

    Yeah I know PS_JOB is a big deal, hence this index has been in test for 3 weeks before we even considered a production migration.

    Thanks to both of you for your feedback
    I'm stmontgo and I approve of this message

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