Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2006
    Posts
    58

    Question Unanswered: How to use query analyzer to find the most efficient one in many select statements?

    Hi, everyone.

    I have read a lot of topics about execution plan for query, but I got little.
    Please give me some help with examples for comparing different select statements to find the best efficient select statement.

    Thank you very much.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Avoid table scans like the plague. Use "where" clauses whenever possible to reduce the amount of raw data you're working with. Make sure you have proper indexing. Also, read this:

    http://www.databasejournal.com/featu...le.php/1437391
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Oct 2006
    Posts
    55
    hi,
    you can check this web site : http://www.sqlservercentral.com/colu...intversion.asp
    it's under (Using The Index Hint) section
    good luck
    Peace out
    Mr joka

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    A simple "first pass" that can sometimes make it clear which statement is a dog and which is good is to:

    Pop all your select statements in a single window in QA. Hit Ctrl + K. Hit F5. Look at the query plan window.

    You will see a plan for each statement including an "overall cost" for each statement. Sometimes this shows you clearly which is better\ worse without a need to look much further.

    For more detailed optimisation you need to look at the individual components of the plans, run things like SET STATISTICS IO ON, SET STATISTICS TIME ON, look at Profiler and so on.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    IMHO you should avoid index hints until you are much more comfortable with optimisation and query tuning.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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