View Editor tab - Statistics

Last modified: May 28, 2025

The Statistics tab allows you to view and configure table statistics for query optimization.

View Editor - Statistics

Generate new statistics

To generate statistics:

1. In the left grid, right-click the row and select New Statistics.

Alternatively, press Ins.

2. In the right grid, specify the general properties:

  • In the Statistics Name box, enter a statistics name.
  • In the Filter Expression box, specify the filter expression and select OK to save the expression or select Cancel to discard the changes.
  • In the SAMPLE box, choose sample options.
  • In the Statistics columns grid, select the column under Name. To remove the column, select the column and select Remove on the Statistics columns grid toolbar.
  • Under the Statistics columns grid, select the NORECOMPUTE checkbox to control whether SQL Server automatically updates statistics. When selected, SQL Server does not update statistics automatically. When cleared, SQL Server updates statistics when needed.
  • Under the Statistics columns grid, select the INCREMENTAL checkbox to specify whether statistics updates are partition-based. When selected, it updates only the changed partitions instead of the entire table.

Tip

You can sort statistics columns using the Move up and Move down options in the Statistics columns grid.

3. To save the statistics, on the View Editor toolbar, select Apply Changes.

View and manage additional statistics settings

General

The General settings display the name, filter expression, sample of the statistics, and the columns the statistics is generated in.

You can perform the following actions:

  • Remove a column from the statistics.
  • Reorder columns by moving them up or down in the grid.
  • Identify whether the column is NOT NULL.

In addition, this section displays whether the statistics is NORECOMPUTE and INCREMENTAL.

Details

The Details settings contain the following components:

  • Statistics Header that contains metadata about the statistics object, including the name of the statistics object, average key length, filter expression, etc.
  • Density Vector that describes the uniqueness of values in a column, helping to estimate cardinality.
  • Histogram Data that breaks down data distribution into buckets to estimate ranges of values in the column.

Delete statistics

To delete statistics, in the left grid, right-click the row and select Delete Statistics.

Alternatively, press Ctrl+Del.

View statistics details

In the left grid, you can view statistics details:

  • Name – Indicates the name of the object for which statistics are generated.
  • Columns – Lists the columns used to generate statistics.
  • NORECOMPUTE – Controls whether SQL Server automatically updates statistics. When selected, SQL Server does not update statistics automatically. When cleared, SQL Server updates statistics when needed.
  • INCREMENTAL – Specifies whether statistics updates are partition-based. When selected, it updates only the changed partitions instead of the entire table.
  • Last Updated – Shows the last time statistics were updated.

Save changes

An asterisk (*) in the object name on the tab title indicates unsaved changes. To save and apply them, select Apply Changes.

Refresh the view

To update the view to reflect the latest changes, on the View Editor toolbar, select Refresh Object.

Generate a SQL script

To generate a SQL script:

1. On the View Editor toolbar, select the Show Script Changes arrow in the Script Changes list.

2. To open the generated script in a new SQL document, select To New SQL Window.

Alternatively, press Shift+Alt+C.

3. To copy the generated script to the clipboard, select To Clipboard.

This script allows you to review, modify, or execute the script manually instead of applying changes immediately.