Collecting statistics on columns and indexes provides the Optimizer with data demographic information it uses to generate efficient query plans that execute as quickly as possible.
- Display the Query Development perspective.
- In the Data Source Explorer, select the table columns and indexes for which you wish to collect statistics. You can select more than one column and index in more than one table by holding the Ctrl or Shift key while you click.
- Right-click a selected column or index, and click The .Statistics Collection view opens, listing the columns and indexes you selected.
- [Optional] Select one or more of the items in the Statistics Collection Objects list and click Remove to prevent statistics from being collected on those objects. The items are removed from the Statistics Collection list.
- [Optional] To create a multi-column statistic object, select one or more columns in the Statistics Collection Objectslist and click Add Multi-Column. A multi-column entry for the selected columns is added to the list.
- Click Collect. The Collect Statistics wizard opens.
- [Optional] Click Options>> to expand the table to display statistic collection options and specify the options you want for each object. Tip: Hover your mouse over the Options cells for more information on each option.
Do one of the following:
- Click Next to inspect the SQL that will be issued to the connected database to start statistics collection.
- Click Finish to collect the statistics.