Table Statistics

Statistics gathered over tables in the database can be found in the system view sys.statistics. This is explicitly updated using the ANALYZE statement:

ANALYZE schemaname [ '.' tablename [ '('columnname , ...')' ] ]

The system administrator can gather statistics for a) all tables in a schema or b) all columns of a specific table or c) a list of specific columns of one table. You can only gather statistics of tables with real physical column data, so not for views.

Since statistics gathering involves accessing and profiling all table columns data, it can take considerable time, especially if the tables are large or you analyze all tables in a schema.

Starting on Jan2022 release, in order to mitigate the I/O required to update the 'statistics' table, this table is no longer persisted. Alternately, it was changed into a computed view every time when queried.

In the Jan2022 release, the performance of the ANALYZE operator has improved, therefore the MINMAX parameter is now ignored. At the same time, the statistics are now used in SQL query optimization, so the SAMPLE operator is also ignored.