Table Statistics

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

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

You can only gather statistics of tables with real physical column data, so not for views.
The system administrator or owner of a table 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.

ANALYZE "work"."mytable" ("col1", "col2", "col9");
ANALYZE work.mytable;

Since statistics gathering involves accessing and profiling all columns data, it can take considerable time when 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. It has been changed into a table producing system function sys.statistics() and a system view sys.statistics. Hence it is also no longer possible to do deletes on this table (to remove old statistics).

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.