Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements >

UPDATE STATISTICS

Use the UPDATE STATISTICS statement to perform any of the following tasks:

This statement is an extension to the ANSI/ISO standard for SQL.

Syntax

Read syntax diagramSkip visual syntax diagram>>-UPDATE STATISTICS-------------------------------------------->
 
     .-LOW-.
>--+-+-----+--+----------------------------+--+--------------------+--------+-><
   |          '-| Table and Column Scope |-'  '-DROP DISTRIBUTIONS-'        |
   |                                                                   (1)  |
   +-+-MEDIUM-+--+----------------------------+--| RESOLUTION Clause |------+
   | '-HIGH---'  '-| Table and Column Scope |-'                             |
   |                        (2)                                             |
   '-| Routine Statistics |-------------------------------------------------'
 
Table and Column Scope:
 
|--FOR TABLE--+----------------------------------------------------------------+--|
              +-+-----------+-+-table---+-+------------------+-----------------+
              | '- 'owner.'-' '-synonym-' |    .-,------.    |                 |
              |                           |    V        |    |                 |
              |                           '-(----column-+--)-'                 |
              '-ONLY-- (--+-----------+--+-table---+-- )--+------------------+-'
                          '- 'owner.'-'  '-synonym-'      |    .-,------.    |
                                                          |    V        |    |
                                                          '-(----column-+--)-'
 
Notes:
  1. See Resolution Clause
  2. See Routine Statistics

Element Description Restrictions Syntax
column A column in table or synonym Must exist. With MEDIUM or HIGH keywords, column cannot be of BYTE or TEXT data type Identifier
synonym Synonym for a table whose statistics are to be updated The synonym and the table to which it points must exist in the current database Database Object Name
table Table for which statistics are to be updated Must exist in the current database or be a temporary table created in the current session Database Object Name

Usage

Use the UPDATE STATISTICS statement to update system catalog information that the query optimizer uses for operations on objects in the local database.

You cannot, however, update the statistics for a table or the query plan of a UDR that is external to the current database. That is, the database server ignores remote database objects when executing the UPDATE STATISTICS statement.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]