UPDATE STATISTICS is typically run on large tables with the SAMPLE clause. This ensures that a random sample of the table's data is used to compute statistics of adequate quality. By default the sampling ratio is 1% of all rows or 1 million rows, whichever is smaller. Sometime we have a sample table that was created for some other reason and wish to instruct UPDATE STATISTICS to use the existing table rather than create a new one. Also occasionally UPDATE STATISTICS may error out while creating or populating the sample table. The steps here can be used to create, populate and then use the resulting sample table for UPDATE STATISTICS.
Our objective here is to run this command and obtain statistics for table tab1
UPDATE STATISTICS FOR TABLE tab1 ON EVERY COLUMN SAMPLE;
Add the steps involved:
| You may also want to use visual panels to communicate related information, tips or things users need to be aware of. |
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.
|