Starting with DB2® Version
9.7 Fix
Pack 1, distribution statistics can be collected for XML columns to
support faster queries over the data in XML columns. Distribution
statistics are collected for indexes over XML data of type VARCHAR,
DOUBLE, TIMESTAMP, and DATE.
For DB2 V9.7 Fix Pack 1 and
later, distribution statistics on an XML column can be collected.
- Distribution statistics are collected for indexes over XML data
of type VARCHAR, DOUBLE, TIMESTAMP, and DATE. XML distribution statistics
are not collected for indexes over XML data of type VARCHAR HASHED.
- Distribution statistics are collected for each index over XML
data specified on an XML column.
- XML distribution statistics are collected when automatic table
RUNSTATS operations are performed.
To collect distribution statistics on an XML column using the RUNSTATS
utility, both distribution statistics and table statistics must be
collected. Table statistics must be gathered in order for distribution
statistics to be collected because XML distribution statistics are
stored with table statistics. As the default, the RUNSTATS utility
collects a maximum of 250 quantiles for distribution statistics for
each index over XML data. The maximum number of quantiles for a column
can be specified when executing the RUNSTATS utility.
The following list describes the situations in which XML distribution
statistics are not created or collected:
- XML distribution statistics are not created when loading data
with the STATISTICS option.
- XML distribution statistics are not collected for partitioned
indexes over XML data defined on a data partitioned table.
- XML distribution statistics are not collected when collecting
only index statistics, or collecting index statistics during index
creation.