When Execution Plans are the Same

  • Okay, they are not exactly the same, but aside from a percentage one way or another, I have 2 execution plans that, at first glance, are almost identical.

    There is a very pronounced performance difference between both queries, though. My question is, when you have two almost identical execution plans, what plan parts do you look at to figure out the bottleneck?

    Thoughts?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • estimate vs actual.

    Optimization level (early terminaison reason)

  • Post em?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • I'm looking at estimated plans right now, so I suppose the first thing to do is get the actual plans. Verify the information is still the same at that point.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Yup. The operators should be the same, the additional data on actual row count is the most useful .

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Everyone has hit a lot of the highlights, I especially like checking the SELECT operator properties to see the compile & runtime values on params & the reason for early termination. After that, it's the long slog of digging into the details on the operators to see what variations might result in the differences.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

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

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