Statistics

Index statistics provide information about the data distribution in indexed columns and are used by the query optimizer to generate efficient execution plans.

Database Explorer allows you to perform operations on statistics using the shortcut menu. Right-click a statistics in Database Explorer to access commands for specific tasks, such as creating or updating statistics.

Note

Statistics is available only for clustered and nonclustered indexes.

Create new statistics

1. In Database Explorer, right-click the Statistics node and select New Statistics.

2. On the Statistics tab of Table Editor, configure the statistics properties.

3. Click Apply Changes.

Update statistics

To update all statistics, in Database Explorer, right-click the Statistics node and select Update Statistics.

To update specific statistics, in Database Explorer, right-click the statistics you want to update and select Update.

View statistics

1. In Database Explorer, right-click the statistics you want to view and select View Statistics.

Alternatively, double-click the required statistics.

2. On the Statistics tab of Table Editor, view statistics details.

Filter statistics

1. In Database Explorer, right-click the Statistics node and select Filter.

2. In the Filter Settings (Statistics) dialog, configure the filter parameters.

3. Click OK to apply the filter.

Note

When you open the Statistics node, the number of objects it contains appears in parentheses next to the node name. This number changes based on your filter settings.

Refresh statistics

To update statistics to reflect the latest changes, in Database Explorer, right-click the required statistics or Statistics node and select Refresh, or press F5.

Open the Properties window

To open the Properties window, in Database Explorer, right-click the required statistics and select Properties, or press F4.

Shortcut menu options for specific statistics

The following table describes the shortcut menu options, which appear when you right-click specific statistics in Database Explorer.

Name Description
Update Updates statistics.
View Statistics Opens the Statistics tab of Table Editor to view the selected statistics.
Show Details Opens Object Viewer to view object details.
Refresh Updates the object to reflect the latest changes.
Shortcut: F5
Properties Opens the Properties pane to view the object information.
Shortcut: F4

Shortcut menu options for the Statistics node

The following table describes the shortcut menu options, which appear when you right-click the Statistics node in Database Explorer.

Name Description
New Statistics Opens the Statistics tab of Table Editor to create new statistics.
Update Statistics Updates statistics.
Source Control > Source Control Manager Opens Source Control Manager, where you can track and manage changes to database schema and static data.
When Source Control Manager is already open, this option refreshes it.
Source Control > Commit Opens Source Control Manager with all local changes (if any) selected and ready to commit.
When Source Control Manager is already open, this option refreshes it and selects all local database changes.
Source Control > Get Latest Opens Source Control Manager with all remote changes (if any) selected, ready to pull using Get Latest.
When Source Control Manager is already open, this option refreshes it and selects all remote database changes.
Filter Opens the Filter Settings dialog to control which statistics should appear in the table in Database Explorer.
Show Details Opens Object Viewer to view object details.
Refresh Updates the object to reflect the latest changes.
Shortcut: F5

Note

The Source Control shortcut menu is available only if you linked the corresponding database to a source-control system.

Bulk operations

In Database Explorer, hold down Ctrl and select multiple statistics. Then right-click the selection and select the required option.

The following table describes the shortcut menu options available for multiple statistics.

Name Description
Update Updates the selected statistics.
Source Control > Source Control Manager Opens Source Control Manager, where you can track and manage changes to database schema and static data.
When Source Control Manager is already open, this option refreshes it.
Source Control > Commit Opens Source Control Manager with all local changes (if any) selected and ready to commit.
When Source Control Manager is already open, this option refreshes it and selects all local database changes.
Source Control > Get Latest Opens Source Control Manager with all remote changes (if any) selected, ready to pull using Get Latest.
When Source Control Manager is already open, this option refreshes it and selects all remote database changes.
Source Control > View Changes History Opens the Changes History document that displays all revisions, including committed changes.
Source Control > Link/Unlink Static Data Opes the Source Control Link Static Data dialog that displays the tables whose data you want to link.