Updating oracle statistics

configuration parameter affects the sampling rate during statistics collection to determine cardinality in a column.For example, a value of .5 is equivalent to an acceptable error of 50%. Use the parameter to set the acceptable estimated relative error in the cardinality of a table.If the stored information is out of date, the planner can generate inefficient plans.on the parent (main) table, or on the leaf nodes—the partition files where data and statistics are actually stored.The syntax lets you specify a table or indexed view along with a target index name, statistics name, or column name (see below): returns statistics information for the index name, statistics name, or column name of the specified table or in indexed view, however, if you only want to see the statistics update date for all statistics objects that exists for the tables, indexes, and indexed views in the database, you query system catalog view is the best way to see each statistics object information that exists for the tables, indexes, and indexed views in the database.This catalog view exists in SQL Server 2005 and later.

Run again the query to verify that a new statistics object for the Product ID column has been created.

2) By default, the UPDATE STATISTICS statement uses only a sample of records of the table.

Using UPDATE STATISTICS WITH FULLSCAN will scan the entire table.

Using the COLUMNS option of this statement will update column statistics only.

Using the INDEX option will update index statistics only.

Leave a Reply