The Adaptive Server query processor uses statistics about the tables, indexes, partitions, and columns in a query to estimate query costs. The query processor chooses the access method that it determines has the least cost. But to do so, it must have accurate statistics.
Some statistics are updated during query processing. Others are only updated when you run the update statistics command or when indexes are created.
update statistics helps Adaptive Server make the best decisions by creating histograms for each major attribute of the local indexes for a partition, and creating densities for the composite attributes. Use update statistics when a large amount of data in a partitioned table has been added, changed, or deleted.
Permission to issue update statistics and delete statistics defaults to the table owner and is not transferable. update statistics commands lets you update statistics for individual data and index partitions. update statistics commands that yield information on partitions are:
update statistics
update table statistics
update all statistics
update index statistics
delete statistics
For example, to update statistics for the smallvalues partition of the titles table created in “Changing an unpartitioned table to a partitioned table”, enter:
update statistics titles partition smallvalues
See the Reference Manual for detailed information about the update statistics and delete statistics commands.
Copyright © 2005. Sybase Inc. All rights reserved. |