qua_update_object_statistics#
Procedure updates object-level and column-level statistics for a given table or a view. It uses the configuration to derive information from metadata about which statistics to calculate and how.
If possible, the procedure uses native statistics mechanism of underlying database provider.
If the configuration allows using the approximate row count, the procedure tries to use the APPROX_COUNT_DISTINCT function.
In other cases uses regular SQL queries using function COUNT with DISTINCT to gather required information.
Syntax#
qua_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 qua_update_object_statistics @databaseName = 'AdventureWorksDW2012_mssql', @schema_name = 'dbo', @tableName = 'DimDate';