Blog Post

Friday Followup For July 18, 2014

,

lazy_superman

It’s Friday, time to look back at the most popular RealSQLGuy posts of the week. Because it’s Friday and you’re not doing any real work anyway.

Posts That Were Popular This Week

Comments That Were Posted This Week

  • DoctorOwl on Which One’s Better?:
    I couldn’t help but notice you didn’t try any of the EXISTS clauses with TOP 1. So out of pedantism I re-ran all the original tests 4 times each and their TOP 1 counterparts (the execution plans and IO appeared to be the same):

    Elapsed time: 2808 ms

    Elapsed time: 2771 ms

    Elapsed time: 2805 ms

    Elapsed time: 2768 ms

    All originals average at 2778 ms

    vs

    Elapsed time: 2798 ms

    Elapsed time: 2741 ms

    Elapsed time: 2727 ms

    Elapsed time: 2782 ms

    All TOP 1 average at 2762 ms

    I think it’s fair to say that it’s not significant in practice, but also that it’s hard to tell if there’s any actual significant difference between them. I guess if we run that million a million more times…

  • realsqlguy on Which One’s Better?:
    Since EXISTS stops on the first match it finds, it is, in effect, doing a TOP 1. I would expect there to be no difference between them, but as you say, it’s hard to tell.

This Week In History

None, the past holds no lessons this week

That’s it for this week. Get back to work!

batman_retired

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating