Diagnosing and Fixing tempdb Contention from Spills in SQL Server

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024
  • Become a member! www.youtube.co...
    Click here for 50% off a health check: training.erikd...
    If you like what you see here, you'll love my advanced performance tuning training:
    training.erikd...

ความคิดเห็น • 8

  • @flygonfiasco9751
    @flygonfiasco9751 20 วันที่ผ่านมา +1

    Good video, thanks!

  • @sakauk7566
    @sakauk7566 20 วันที่ผ่านมา +1

    Beautiful stuff.

  • @neryanatanov385
    @neryanatanov385 20 วันที่ผ่านมา +2

    Great video, thanks.
    Why does the sort order in the index matter here? Can't SQL Server do backwards scans. When can and can't it do one?

    • @ErikDarlingData
      @ErikDarlingData  20 วันที่ผ่านมา +4

      It can do them. One limitation is doing them in a parallel plan. Other times it may choose not to. Query optimization is a lot like playing the lottery.

  • @thomasfranz8722
    @thomasfranz8722 3 วันที่ผ่านมา

    Why is there no sort operator in the Query Plan at 07:55? Of course it uses the Index on the descending reputation first, but it should still need to order by the ascending Id column - except reputation is unique (in the higher ranges), but even with statistics the SQL server can't know/guarantee this, so it would need to sort.
    A possible reason would, if the ID is the clustered Index and SQL server guarantees, that rows would always be implizit ordered by Reputation DESC + Id ASC, even when the Id is not specified in the CREATE INDEX (the columns of clustered Index will always be included, but I in my opinion unsorted.)

    • @ErikDarlingData
      @ErikDarlingData  3 วันที่ผ่านมา

      Because when there’s an equality predicate which guarantees sort ordering. I’m mobile at the moment but if you search my channel for something like index sort you should find videos about it.