Query performance tuning

  • Hi SQL Gurus,

    I'm new to write storeprocedures and Queris.What are the jobs consider While writing stored procedures and queries,which gives good performance results?

    How can I find the query performance?Example I have table,which is having lacks of records and every week add 50thousads records.I wrote small query like select * from tbl_entity it takes more than 10minits time,how can I impove the performance?

    Thank you in advance.

    Regards

    Suresh Mediboyina

  • The time for that select * is probably a combination of time to get the data off disk and time to get it across the network. Why are you querying the entire of a very large table? Do you really need all of it?

    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
  • Thats right...do you really need to do a SELECT * FROM

    ? Only include the columns you actually need, and if possible add a WHERE clause to limit the result set. Once you know which columns you want to return and which columns can filtered (WHERE clause) you can create some indexes which will help performance.

    If you're not sure about indexing start here:

    http://www.sqlservercentral.com/articles/Indexing/68439/

    http://www.sqlservercentral.com/articles/books/65831/

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

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