SQL Server DBA Interview Questions | When should we update Statistics on SQL Server Database and why

Поделиться
HTML-код
  • Опубликовано: 2 фев 2025

Комментарии • 11

  • @lakshayarora3935
    @lakshayarora3935 5 лет назад

    What should be the average frequency to update stats incase the data is frequently changing or the data is frequently queried?

  • @stevenyenkey6443
    @stevenyenkey6443 5 лет назад +1

    Thanks so much for sharing this

  • @P5toraskar1986
    @P5toraskar1986 9 лет назад

    thank you so much for shared this GK.

  • @nareshtechnical3656
    @nareshtechnical3656 5 лет назад

    Excellent

  • @PavanKumar-vp2yo
    @PavanKumar-vp2yo 9 лет назад +1

    what really happens when update statistics

    • @muthaiahpalaniappan8009
      @muthaiahpalaniappan8009 8 лет назад +7

      As far as I know, Stats will give the cardinality info which will let the optimizer to know the estimated number of rows in the result which helps the optimizer to choose a good execution plan..
      So, if the stats are not up to date, then the optimizer might think the estimated row is very small (say 10) and it might give you an execution plan which might take a longer time to execute (in case if your queries have lot of joins and stuff, then the optimizer will create a execution plan with lot of nested loop by considering it's gonna do this just for 10 rows etc..), , if you have updated the stats, the optimizer get to know the correct estimated number of rows (say 100 thousand) and prepare a different execution plans or it will give you a suggestion to create a missing index.
      Correct me if i'm wrong..
      Hope this helps

    • @PedroPerez-ep9wx
      @PedroPerez-ep9wx 3 года назад

      SQL SERVER FILLS another tables with info about other tables

  • @surekhaanupoju4730
    @surekhaanupoju4730 3 года назад +1

    Thanks sir