Gathering Statistics for Tables

You can generate statistics that measure the data distribution and storage characteristics of tables.

You must gather statistics periodically for tables where the statistics become stale over time because of changing data volumes or changes in column values. The Gather Statistics icon gathers new statistics after the table’s structure are modified in ways that make the previous statistics inaccurate. For example, after loading a significant number of rows into a table, collect new statistics on the number of rows. After updating data in a table, you do not need to collect new statistics on the number of rows, but you might need new statistics on the average row length.

Table Statistics also include column statistics. The statistics you generate include the following:

Table statistics:
  • Table Size: Specifies the size of the table in bytes.
  • Number of rows: Displays the number of rows in the table.
  • Number of columns: Displays the number of columns in the table
  • Compressed size: Displays the size of compressed table in bytes.
  • Statistics gathered on: Displays date and time of last statistics gathered.
Column Statistics
  • Number of distinct values (NDV) in column
  • Number of nulls in column
  • Data distribution (histogram)

The above information is displayed in the statistics details of tables.

Was this article helpful?