Index.UpdateStatistics Index.UpdateStatistics Index.UpdateStatistics Method

Definition

Updates the statistics for the referenced index.

Overloads

UpdateStatistics(StatisticsScanType, Int32) UpdateStatistics(StatisticsScanType, Int32) UpdateStatistics(StatisticsScanType, Int32)

Updates statistics for the referenced index with the specified statistics scan type and specified sample size.

UpdateStatistics(StatisticsScanType) UpdateStatistics(StatisticsScanType) UpdateStatistics(StatisticsScanType)

Updates statistics for the referenced index with the specified statistics scan type.

UpdateStatistics(StatisticsScanType, Int32, Boolean) UpdateStatistics(StatisticsScanType, Int32, Boolean) UpdateStatistics(StatisticsScanType, Int32, Boolean)

Updates statistics for the referenced index with the specified statistics scan type and specified sample size and with the option to recompute the statistics.

UpdateStatistics() UpdateStatistics() UpdateStatistics()

Updates statistics for the referenced index.

UpdateStatistics(StatisticsScanType, Int32) UpdateStatistics(StatisticsScanType, Int32) UpdateStatistics(StatisticsScanType, Int32)

Updates statistics for the referenced index with the specified statistics scan type and specified sample size.

public:
 void UpdateStatistics(Microsoft::SqlServer::Management::Smo::StatisticsScanType scanType, int sampleValue);
public void UpdateStatistics (Microsoft.SqlServer.Management.Smo.StatisticsScanType scanType, int sampleValue);
Public Sub UpdateStatistics (scanType As StatisticsScanType, sampleValue As Integer)
Parameters
scanType
StatisticsScanType StatisticsScanType StatisticsScanType

A StatisticsScanType the method used to update the statistics.

sampleValue
Int32 Int32 Int32

An Int32 value that specifies the sample size.

Examples

Creating, Altering, and Removing Indexes

Remarks

Note

Indexes based partly on the UserDefinedTableType object do not support statistics and running this method will generate an exception.

UpdateStatistics(StatisticsScanType) UpdateStatistics(StatisticsScanType) UpdateStatistics(StatisticsScanType)

Updates statistics for the referenced index with the specified statistics scan type.

public:
 void UpdateStatistics(Microsoft::SqlServer::Management::Smo::StatisticsScanType scanType);
public void UpdateStatistics (Microsoft.SqlServer.Management.Smo.StatisticsScanType scanType);
Public Sub UpdateStatistics (scanType As StatisticsScanType)
Parameters
scanType
StatisticsScanType StatisticsScanType StatisticsScanType

A StatisticsScanType the method used to update the statistics.

Examples

Creating, Altering, and Removing Indexes

Remarks

Note

Indexes based partly on the UserDefinedTableType object do not support statistics and running this method will generate an exception.

UpdateStatistics(StatisticsScanType, Int32, Boolean) UpdateStatistics(StatisticsScanType, Int32, Boolean) UpdateStatistics(StatisticsScanType, Int32, Boolean)

Updates statistics for the referenced index with the specified statistics scan type and specified sample size and with the option to recompute the statistics.

public:
 void UpdateStatistics(Microsoft::SqlServer::Management::Smo::StatisticsScanType scanType, int sampleValue, bool recompute);
public void UpdateStatistics (Microsoft.SqlServer.Management.Smo.StatisticsScanType scanType, int sampleValue, bool recompute);
Public Sub UpdateStatistics (scanType As StatisticsScanType, sampleValue As Integer, recompute As Boolean)
Parameters
scanType
StatisticsScanType StatisticsScanType StatisticsScanType

A StatisticsScanType that specifies the method used to update the statistics.

sampleValue
Int32 Int32 Int32

An Int32 value that specifies the sample value.

recompute
Boolean Boolean Boolean

A Boolean value that specifies whether to recomputed the index statistics or not.

If True, the statistics are recomputed. Otherwise, False.

Examples

Creating, Altering, and Removing Indexes

Remarks

Note

Indexes based partly on the UserDefinedTableType object do not support statistics and running this method will generate an exception.

UpdateStatistics() UpdateStatistics() UpdateStatistics()

Updates statistics for the referenced index.

public:
 void UpdateStatistics();
public void UpdateStatistics ();
Public Sub UpdateStatistics ()

Examples

Creating, Altering, and Removing Indexes

Remarks

This method performs a sample scan on the target table or indexed view. The sample size is automatically computed.

Note

Indexes based partly on the UserDefinedTableType object do not support statistics and running this method will generate an exception.

Applies to