Basic information for automatically updating statistics Algorithm Yes:
· If the base number of the table in the tempdb database is less than 6, each of the six modifications will be automatically updated to the table.
· If the base number of a table is greater than 6 but less than or equal to 500, the update status is changed every 500.
· If the base number is greater than 500, when the table is updating statistics (500 + 20% tables), it is changed.
· Changing the base of a table variable does not trigger automatic update of statistics.
Note: strictly speaking, SQL Server calculates the base number as the number of rows in the table.
Note: In addition to the base, the selectivity of This predicate also affects autostats generation. This means that this statistical information may not be updated. For afer, the base number for each 500 modification is <500 or the base number for each 20% change seems to be> 500. Proportional factors (values range from 1 to 4, 1 and 4) are generated based on selectivity, this factor changes the actual number of modifications required to generate the product autostats of the number obtained from the algorithm.
In the form of a table, the algorithm above summarised can be used:
_________________________________________________________________________________
Table type | empty condition | threshold whenempty | threshold when not empty
_________________________________________________________________________________
Permanent | <500 rows | # ofchanges> = 500 | # of changes> = 500 + (20% of cardinality)
___________________________________________________________________________
Temporary | <6 rows | # ofchanges> = 6 | # of changes> = 500 + (20% of cardinality)
___________________________________________________________________________
Table
Variables | change in cardinality does not affectautostats generation.
___________________________________________________________________________
Author: smithliu328