Understanding Query Plans.

  • Hi folks,

    Can any one help to under stand the query plans generted in the SQL Query Analyzer.

    I have few questions in this regard:

    1. What is the starting point.

    2. Which Direction to move.

     

  • It's quite a big topic. Here's a basic answer to your question.

    You can view query plans in teh graphical viewer in QA, or as text in the results window/profiler/etc.

    In the graphical view, the first steps are to the right, and the final step is on the left. Not all pairs of steps can be put into a clear order, e.g. two steps which each contribute to the step after them may execute 'simultaneously'.

    In the text only view, the order of the steps is shown by indentation. the more indented, the earlier the step. Generally, earlier steps are below later ones but this is not always possible since there is not always a linear order, as mentioned above.

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • U can read the graphical view from left to right & from top to bottom. On each icon, if u point the cursor it will pop-up the results also. For all these icon details u can refere to BOL.

     

  • You can 'read' it in any direction, but you will often want to look at the 'leaf-level' nodes on the diagram - for example you might be looking to replace expensive table scans with (covering) indexes...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • Print out the 18 pages in the link below and you will understand the internal mechanics of the Query processor, the paper was created for SQL Server 7.0 but it explains in detail how it works.  Hope this helps.

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm_8_des_08_116g.asp

    Kind regards,

    Gift Peddie

    Kind regards,
    Gift Peddie

Viewing 6 posts - 1 through 5 (of 5 total)

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