datachange

Description

Measures the amount of change in the data distribution since update statistics last ran. Specifically, it measures the number of inserts, updates, and deletes that have occurred on the given object, partition, or column, and helps you determine if invoking update statistics would benefit the query plan.

Syntax

datachange(object_name, partition_name, column_name)

Parameters

object_name

is the object name in the current database.

partition_name

is the data partition name. This value can be null.

column_name

is the column name for which the datachange is requested. This value can be null.

Examples

Example 1

Provides the percentage change in the au_id column in the author_ptn partition:

select datachange("authors", "author_ptn", "au_id")

Example 2

Provides the percentage change in the authors table on the au_ptn partition. The null value for the column_name parameter indicates that this checks all columns that have historgram statistics and obtains the maximum datachange value from among them.

select datachange("authors", "au_ptn", null)

Usage

datachange is reset or initialized to zero when:

datachange has the following restrictions:

Permissions

Any user can execute datachange.