• SQL Kiwi (9/30/2011)


    Gianluca Sartori (9/30/2011)


    As you can see, in this case STATISTICS IO returns objects in reverse order. Is this sensible and/or guaranteed/documented? I couldn't find anything on the subject.

    I don't know the answer to that; however I'm pretty sure it isn't documented or guaranteed.

    Thank you, Paul.

    I did a couple of tests and turns out that it was just a coincidence. Well, not entirely: the order of the tables in the STATISTICS IO output is often very similar to the execution order in the query plan, but it starts diverging when tables are accessed more than once, or parallelism kicks in, or... many other things.

    -- Gianluca Sartori