Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2005
    Posts
    220

    Unanswered: How can I speed up this query?

    Can anyone give me an idea on how I can speed up this query?

    Code:
    SELECT l.P_PLANNERCODE 
    , s.LOC 
    , COUNT(*) 
    FROM stsc.SKU s, stsc.LOC l 
    WHERE s.p_deleteme = 'DELETEME' 
    AND s.LOC = l.LOC 
    AND l.p_mdistatuscode = 'LIVE'
    GROUP BY l.P_PLANNERCODE, s.LOC HAVING COUNT(*) >= 400 
    ORDER BY 1,2

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    please post explain plan
    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
    Nov 2003
    Posts
    22
    I think you need to provide more information of your query. What's the size of the table? Do you have any index on the tables?

  4. #4
    Join Date
    Nov 2003
    Posts
    22
    Explain Plan is also usefull

  5. #5
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    A blind guess (until you provide some more information) would be to check whether both tables have indexes on LOC columns.

  6. #6
    Join Date
    Sep 2005
    Posts
    220
    I have attached the explan plan for your review
    Attached Files Attached Files

Posting Permissions

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