Home Database Mysql Tutorial SQL Server自动更新统计信息的基本算法

SQL Server自动更新统计信息的基本算法

Jun 07, 2016 pm 06:07 PM
Automatic updates

最初接触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.
___________________________________________________________________________
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to disable Windows Update from automatically updating drivers in win11? How to disable Windows Update from automatically updating drivers in win11? Jun 26, 2024 am 12:18 AM

When you connect any new hardware device to the system, Windows will automatically try to install the driver for it. When the system's built-in driver package cannot be recognized, it will automatically try to connect to Windows Update to search and install the driver. Windows can also automatically update device drivers through Windows Update without user interaction. Although this function seems convenient, under certain circumstances, the feature of automatically updating drivers can cause trouble for users. For example, users' video workflows such as DaVinciResolve, Adobe Premiere, etc. need to use a specific old version of Nvidia Studio driver. As a result, Windows

How to disable automatic updates in Win11 How to disable automatic updates in Win11 Dec 27, 2023 pm 12:53 PM

Many users always receive automatic updates from the system when using their computers on a daily basis, which not only slows down the computer but also causes it to become stuck. For this reason, today we bring you how to operate Win11 if you don’t want to automatically update. If automatic updates keep affecting you, Let’s see how to close it. How to prevent Windows 11 system from automatically updating 1. First, right-click "This PC" on the desktop and select "Manage". 2. In the opened "Computer Management", click "Services" → "Applications" → "Services" → "Windows update". 3. Next, double-click "Windows update", set the "Startup type" to "Disabled", click "Stop" service and confirm. 4. Click the "Recover" tab to restore the first lost

Group policy method to turn off automatic updates in win10 Group policy method to turn off automatic updates in win10 Dec 23, 2023 pm 05:07 PM

When using win10 system, we all often encounter update problems. This update is sometimes very annoying, so how can we solve this problem? This requires us to enter the local group policy to set it. How to turn off automatic updates in Win10 Group Policy: 1. Press "win+R" on the keyboard to open Run, enter "gpedit.msc" and click OK. 2. Select "Administrative Templates" - "Windows Components" and double-click to enter. 3. Then find "Windows Update" and double-click to enter. 4. Find "Configure automatic updates" on the right and double-click to open it. 5. Then check "Disabled" and click "Apply".

How to develop a feature that automatically updates a WordPress plugin How to develop a feature that automatically updates a WordPress plugin Sep 05, 2023 am 10:40 AM

How to Develop an Auto-Updating WordPress Plugin WordPress is a very popular open source content management system (CMS) with a rich plugin market to extend its functionality. To ensure that plugins are always up to date and secure, developers need to implement automatic updates. In this article, we’ll walk you through how to develop an auto-updating WordPress plugin and provide code examples to help you get started quickly. Preparation Before starting development, you need to prepare the following key steps: Create

How to turn off automatic updates on Redmi 13c? How to turn off automatic updates on Redmi 13c? Mar 04, 2024 pm 09:49 PM

Today’s mobile phones are becoming more and more powerful, with more and more comprehensive functions, and also provide users with a more comfortable experience. As the latest new model released, Redmi13C also has many functions and also provides users with There are many new designs coming, so how to turn off automatic updates on Redmi 13c? Let the editor of this website briefly introduce the functions to you. If you need it, you can come and take a look. How to turn off automatic updates on Redmi 13c? 1. Open the phone settings and click My Device. 2. Click MIUI version. 3. Click on the three dots in the upper right corner. 4. Click System Update Settings. 5. Turn off the switches behind automatic downloads and smart updates. It is necessary to know about turning off automatic updates. The above is the Redmi 13

How to turn off automatic updates when downloading office 2016 - How to turn off automatic updates when downloading office 2016 How to turn off automatic updates when downloading office 2016 - How to turn off automatic updates when downloading office 2016 Mar 04, 2024 pm 04:34 PM

Many people are using office 2016 download in the office, but do you know how to turn off automatic updates in office 2016 download? Below, the editor will tell you how to turn off automatic updates in office 2016 download. Interested users can take a look below. First open a component. For example, you can open the EXCEL spreadsheet software of Office 2016. Other components are also available. Click the file menu in the upper left corner of the interface and operate as shown. Find the account option here on the left, open it, and start the operation. Click the Disable updates button in the update options. When the Office update shows that this product cannot be updated, it means that our settings are complete. When we need to update in the future, we

How does Kirin OS provide automatic update and upgrade functions? How does Kirin OS provide automatic update and upgrade functions? Aug 06, 2023 pm 05:49 PM

How does Kirin OS provide automatic update and upgrade functions? With the continuous advancement of technology and the increasing importance of operating systems, users have increasingly higher requirements for the stability, security and functions of operating systems. In order to meet the needs of users, the operating system needs to provide automatic updates and upgrades, fix vulnerabilities and add new features in a timely manner. As a domestically developed operating system, Kirin operating system is no exception. It provides automatic update and upgrade functions. In the Kirin operating system, the automatic update and upgrade functions are mainly through the software package manager and update software.

How to turn off automatic updates permanently in win11 How to turn off automatic updates permanently in win11 Mar 27, 2024 pm 04:43 PM

Turn off method: 1. Turn off updates through system settings; 2. Disable Windows Update service through Service Manager; 3. Use Group Policy rules (Professional version or higher only).

See all articles