SQL Server 自动更新统计信息的基本算法
最初接触SQL Server的时候认为SQLServer数据更改的同时就会相应的更新统计信息,其实SQL Server不是这样做的.基于性能考虑,SQL
最初接触SQL Server的时候认为SQLServer数据更改的同时就会相应的更新统计信息,其实SQL Server不是这样做的.基于性能考虑,SQL Server使用下面的算法更新统计信息。
自动更新统计信息的基本算法是:
· 如果表格是在 tempdb 数据库表的基数是小于 6,自动更新到表的每个六个修改。
· 如果表的基数是大于 6,但小于或等于 500,更新状态每 500 的修改。
· 如果基数大于 500,,表为更新统计信息时(500 + 20%的表)发生了更改。
· 表变量为基数的更改不会触发自动更新统计信息。
注意:此严格意义上讲,SQL Server 计算基数为表中的行数。
注意:除了基数,该谓语的选择性也会影响 AutoStats 生成。这意味着该统计信息可能无法更新的 afer 每 500 修改基数是 500。比例因子(值的范围从 1 到 4、 1 和 4 之间)上生成根据选择性,这一因素的更改从算法获得数的乘积 AutoStats 生成所需的修改的实际数目。
在表的窗体中,可以summarised 以上算法:
_________________________________________________________________________________
Table Type | Empty Condition | Threshold WhenEmpty |Threshold When Not Empty
_________________________________________________________________________________
Permanent | = 500 | # of Changes >=500 + (20% of Cardinality)
___________________________________________________________________________
Temporary | = 6 | # of Changes >=500 + (20% of Cardinality)
___________________________________________________________________________
Table
Variables | Change in cardinality does not affectAutoStats generation.
___________________________________________________________________________

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Microsoft SQL Server is a relational database management system launched by Microsoft. It is a comprehensive database platform that uses integrated business intelligence (BI) tools to provide enterprise-level data management. It is easy to use, has good scalability, and has a high degree of integration with related software. High advantages. The SQL Server database engine provides more secure and reliable storage functions for relational data and structured data, allowing users to build and manage highly available and high-performance data applications for business.

SQLServer or MySQL? The latest research reveals the best database selection. In recent years, with the rapid development of the Internet and big data, database selection has become an important issue faced by enterprises and developers. Among many databases, SQL Server and MySQL, as the two most common and widely used relational databases, are highly controversial. So, between SQLServer and MySQL, which one should you choose? The latest research sheds light on this problem for us. First, let

With the popularity of the Internet, website and application development has become the main business of many companies and individuals. PHP and SQLServer database are two very important tools. PHP is a server-side scripting language that can be used to develop dynamic websites; SQL Server is a relational database management system developed by Microsoft and has a wide range of application scenarios. In this article, we will discuss the development of PHP and SQL Server, as well as their advantages, disadvantages and application methods. First, let's

Introduction to how to use PDO to connect to a Microsoft SQL Server database: PDO (PHPDataObjects) is a unified interface for accessing databases provided by PHP. It provides many advantages, such as implementing an abstraction layer of the database and making it easy to switch between different database types without modifying a large amount of code. This article will introduce how to use PDO to connect to a Microsoft SQL Server database and provide some related code examples. step

In web development, the combination of PHP and MySQL is very common. However, in some cases, we need to connect to other types of databases, such as SQL Server. In this article, we will cover five different ways to connect to SQL Server using PHP.

With the continuous development of the Internet, database selection has become increasingly important. Among the many databases, SQLServer and MySQL are two high-profile options. SQLServer is a relational database management system developed by Microsoft, while MySQL is an open source relational database management system. So how to choose the best database solution between SQLServer and MySQL? First, we can compare these two databases in terms of performance. SQLServer is processing

SQL Server vs. MySQL: Which database is more suitable for high availability architecture? In today's data-driven world, high availability is one of the necessities for building reliable and stable systems. As the core component of data storage and management, the database's high availability is crucial to the business operation of the enterprise. Among the many databases, SQLServer and MySQL are common choices. So in terms of high availability architecture, which database is more suitable? This article will compare the two and give some suggestions.

SQLServer vs MySQL: Which is better for mobile app development? With the rapid development of the mobile application market, it has become increasingly critical for developers to choose a database management system suitable for mobile application development. Among the many choices, SQLServer and MySQL are two database systems favored by developers. This article will focus on comparing these two database systems to determine which is better for mobile application development, and demonstrate their differences through code examples. SQLServer is Microsoft
