Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2017 August SQL Server Interview: What is the difference between AUTO_UPDATE_STATISTICS and AUTO_UPDATE_STATISTICS_ASYNC

SQL Server Interview: What is the difference between AUTO_UPDATE_STATISTICS and AUTO_UPDATE_STATISTICS_ASYNC

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

SQL Server Database Statistics is one of the important topics in the Query optimization. I already wrote a couple of articles on SQL Server Database Statistics.

SQL Server: Enable Auto Create and Auto Update Statistics

In the Interview of SQL DBA, If you say like you are also good in Query Optimization, there is 99% chance that interviewer asks questions on SQL Database Statistics.

Why is Database Statistics important?

Simple answer – Query optimizer creates a query execution plan basis on Object Statistics information like record count, some real pages, page location. If statistics are not up to date, it generates the wrong query execution plan which will slow down the query performance.

How can we update Statistics automatically?

Statistics updates can be either synchronous (the default) or asynchronous.

AUTO_UPDATE_STATISTICS – For synchronous update:
This is a synchronous option, and if it is running, a query has to wait for updated statistics. Updating statistics synchronously is the default behaviour, and once the statistics are updated, then the query will be executed.

1
2
ALTER DATABASE database_name SET AUTO_UPDATE_STATISTICS ON
GO

AUTO_UPDATE_STATISTICS_ASYNC – For asynchronous update:
This is an asynchronous option, and if it is running, a query hasn’t required waiting for updated statistics because the query will be executed against the existing statistics.

In the background, at the same time database statistics update automatically using AUTO_UPDATE_STATISTICS_ASYNC option.
Once the background statistics update process completes, the new query can use the newly updated database statistics.

1
2
3
4
ALTER DATABASE database_name SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE database_name SET AUTO_UPDATE_STATISTICS_ASYNC ON
GO

Please note: Before enabling the AUTO_UPDATE_STATISTICS_ASYNC option, Must have AUTO_UPDATE_STATISTICS enabled first

Aug 3, 2017Anvesh Patel
MySQL: Install MySQL Tuner to get Performance Metrice in Ubuntu 16.04SQL Server: Script to execute Update Statistics for all Databases

Leave a Reply Cancel reply

CAPTCHA
Refresh

*

Anvesh Patel
Anvesh Patel

Database Engineer

August 3, 2017 SQL Server, SQL Server InterviewAnvesh Patel, database, database research and development, Database Statistics, dbrnd, SQL Query, SQL Server, SQL Server Administrator, SQL Server Error, SQL Server Interview, SQL Server Monitoring, SQL Server Performance Tuning, SQL Server Programming, SQL Server Tips and Tricks, TSQL
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....