Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
Recreates the column statistics used by the optimizer, and stores them in the ISYSCOLSTAT system table.
CREATE STATISTICS table-name [ ( column-list ) ]
The CREATE STATISTICS statement recreates the column statistics that SQL Anywhere uses to optimize database queries, and can be performed on base tables, local temporary tables, and global temporary tables. You cannot create statistics on proxy tables. Column statistics reflect the distribution of data in the database for the specified columns. By default, column statistics are automatically created for tables with five or more rows.
In rare circumstances, when your database queries are very variable, and when data distribution is not uniform or the data is changing frequently, you can improve performance by running the CREATE STATISTICS statement against a table or column.
When executing, the CREATE STATISTICS statement updates existing column statistics regardless of the size of the table, unless the table is empty, in which case nothing is done. If column statistics exist for an empty table, they remain unchanged by the CREATE STATISTICS statement. To remove column statistics for an empty table, execute the DROP STATISTICS statement.
The process of running CREATE STATISTICS performs a complete scan of the table.
The CREATE STATISTICS statement should be used only in rare circumstances.
Must have DBA authority.
Query plans may change.
SQL/2003 Vendor extension.