Performance on the query

  • Hello,

    I need to improve performance on these query, when I run this query without where clause it takes seconds, when I run where clause, it take couple minutes.How can I iprove performance? I am Thank you

    SELECT Emp_ID fROM qry_Employee where emp_id = 25000

  • Check the plan for the query with the where condition. I bet you have an index seek with bookmark lookup which is actually more expansive than a full scan.

    I'd try updating the stats or rebuilding the index... if that doesn't do it then look into parameter sniffing.

  • Here I included a copy of my plan.Can you please assist me with that.Thank you

  • Please attach the actaul plan... there's way more data we need to see besides the operators and %.

    P.S. I see you are using SSMS, is the server sql 2000 or maybe the compatibility level at 80??

  • I can't save execution plan, it is grey out

  • never seeen that b4...

  • Ninja's_RGR'us (5/23/2011)


    never seeen that b4...

    SQL 2000 server.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (5/23/2011)


    Ninja's_RGR'us (5/23/2011)


    never seeen that b4...

    SQL 2000 server.

    Ya but I was under the impression that ssms was generating that file, so I assumed it could word on sql 2k... but obviously I was wrong ;-).

  • Ninja's_RGR'us (5/23/2011)


    Ya but I was under the impression that ssms was generating that file, so I assumed it could word on sql 2k... but obviously I was wrong ;-).

    No, it's the SQL engine that generates the file. All that SSMS does if you select 'include actual execution plan' is to run SET STATISTICS XML ON before it runs the query and then convert the xml that SQL returns into a graphical reprentation.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 9 posts - 1 through 8 (of 8 total)

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