How to optimize the query

  • Hi,

    I would like to know some tips with examples that i can optimize the query written by programmer?

    Regards,

    Sunil Kumar

  • There a lot of different things you can do to optimise a query, fromm removing cursors , correct indexing and reducing the number of columns selected.

    Post up a copy of the query for some specific help..

  • You should start looking at the execution plans (from SSMS Query>Display Estimated Execution Plan - or - CONTROL L) and the DISK IO (SET STATISTICS IO ON / OFF). Additionally, review the book / article written by Grant Fitchey which is either linked to or up on this site for some great insight which will take you farther.

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • Lot of info about Query Tunings etc..

    Avoid too many joins

    Your Query optimization in overall is dependant on your Database design.

    Index play a IMP part.

    Get Covering indexes, on mostly used columns

    Avoid indexes on TEXT/CHAR columns

    Reconfigure/rework your Quries depending upon the execution plans.

    Even Statistics will play a IMP part..or you see your optimized Query takes a long time to produre results.

    UPDATE them regularly.

    http://blogs.msdn.com/sqlqueryprocessing/default.aspx

    http://www.mssqltips.com/category.asp?catid=37

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

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