Query Optimization

  • Hi,

    I am working with sql server 2000 and 2005,could any one suggest me how to

    optimize a select query which is also using aggregate function on some of its columns.

    I have tried the following alternatives,

    1. I have used index on the table which is using the column order same as in where clause.but in this case RID/KEY lookup is taking primary key index and consuming most of the cost of the QUERY EXECTION.

    Execution Plan Of this case is Shown in Image-1

    2. To avoid RID/KEY lookup,I have used INCLUDE Index,So that all the non primary keys are also included in index.In this case Sort Operator is consuming too much time and again i am at the same place,no improvement in reducing Execution time of Query.

    Execution Plan for this case is shown in image-2 below where sort opertator is taking 70% of CPU Cost.

    Please help me out of this issue.

  • Please attach the actual execution plan (not the estimated) as sqlplan files. Jpegs won't help much here...

    Also, please post table and index definition of all tables involved and the actual query (since it might not be shown completely in the sqlplan).

    As a side note: I don't think this question has anything to do with Notification Services. Why did you use this forum then to post your question? But there's no reason to re-post it. Just make sure to pick the correct forum with your next question (assuming there'll be one...)



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • thx LutzM

    Now i have post my problem on this link

    http://www.sqlservercentral.com/Forums/Topic1189699-360-1.aspx

    could u plz suggest me,solution to my problem.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply