COPY STATISTICS
Valid in: SQL, ESQL, OpenAPI, ODBC, JDBC, .NET
The COPY STATISTICS statement copies in-memory statistics created by autostats (automatic statistics generation) into the system catalogs so that they are available after a restart.
This statement has the following formats:
COPY STATISTICS|STATS FOR table [(column-list)] {, table [(column-list)]} TO CATALOG
COPY STATISTICS|STATS FOR ALL TABLES TO CATALOG
COPY STATISTICS|STATS FOR ALL user TABLES TO CATALOG
table [(column-list)] {, table [(column-list)]}
Copies statistics for the specified tables or for only the specified columns in the tables.
user
Copies statistics for all tables owned by the specified user.
COPY STATISTICS Example
Copy the automatically generated statistics to catalog the columns orderstatus, totalprice, and orderdate in the orders table:
COPY STATISTICS FOR orders (orderstatus, totalprice, orderdate) TO CATALOG
Last modified date: 06/28/2024