lyft_update_object_statistics

Updates statistics (rowcount and distinct count) for given table.

If possible, it uses native statistics mechanism of underlying database provider. If configuration allows usage of approximate row count, tries to use approximate count function. In other case uses regular SQL queries (COUNT and DISTINCT) to gather needed information.

Respects table and column statistics configuration.

Syntax

lyft_update_object_statistics 'databaseName', 'schemaName', 'tableName' [;]

Arguments

'databaseName'

Name of the database in which table is present.

'schemaName'

Name of database's schema in which table is present.

'tableName'

Name of a table which statistics are to be updated.

Example

Updates objects statistics for AdventureWorksDW2012_mssql.dbo.DimDate.

EXEC lyft_update_object_statistics @databaseName = 'AdventureWorksDW2012_mssql', @schema_name = 'dbo', @tableName = 'DimDate';

See Also