Top 5 tips for performance tuning using execution plan in SQL Server

Поділитися
Вставка
  • Опубліковано 29 вер 2024
  • Top 5 tips for performance tuning using execution plan
    Top 1. Search for Lazy Spool Operator, points to duplicate aggregation operations. This is most expensive operator.
    Top 2: Hash match, points to missing index.
    Top 3: Non SARGable queries, use of functions or expression in where conditions. Example cast(column as date)='2023-01-01', Left(col,2)='SA', etc
    Top 4: Partition Elimination
    Top 5: Bad Views
    #shorts

КОМЕНТАРІ • 3

  • @blackisblack22
    @blackisblack22 Рік тому

    How to refactor CAST(COL AS DATE) and CAST(COL,2) to make it sargable?

    • @techsapphire
      @techsapphire  Рік тому +1

      for date time you can use Between clause example Col between '2023-01-01' and '2023-01-02', for left you can use Like or computed column with index

    • @blackisblack22
      @blackisblack22 Рік тому

      @@techsapphire Thank you 🤝