Object Use Count Cache - Advanced SQL Engine - Teradata Database

SQL Request and Transaction Processing

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
ykx1561500561173.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1142
lifecycle
previous
Product Category
Teradata Vantageā„¢

About the Object Use Count Cache

The object use count cache, or OUC cache, tracks object access use counts, UDI (UPDATE, DELETE, INSERT) counts, and statistics access counts for DML requests made against Teradata Database.

The system uses the object use count cache information for various purposes, including:

  • Query optimization
  • Performance monitoring
  • Database object optimization
  • Statistics management

Because only table-level insert and delete UDI counts are needed for cardinality estimation, Teradata Database records that information in the OUC cache. Column-level update counts are only needed when the Optimizer is deciding whether a COLLECT STATISTICS request can be skipped because it fails to meet one or more USING thresholds, so column-level update counts are only retrieved when necessary.

When Teradata Database flushes the OUC cache, it writes its data to the dictionary table DBC.ObjectUsage. See Data Dictionary for the definition of the ObjectUsage table.

The following is populated in the object use count cache with both object use count and UDI data:
  • Table
  • View
  • Macro
  • Trigger
  • Join index
  • Hash index
  • Statistics
Runtime data on the following step-level operations:
  • Delete
  • Insert
  • Update

Flushing the OUC Cache to Disk

The OUC cache must be flushed periodically to avoid the accumulation of stale use counts in DBC.ObjectUsage. The following criteria trigger a flush of the OUC cache to disk:

  • When a specific user-defined time interval is reached.

    You can specify a time-based flushing interval using the DBS Control field ObjectUseCountCollectRate. Teradata Database flushes the OUC cache when either of the following events first occurs.

    • The specified elapsed time since the last flush of the cache is reached.
    • The cache is full.

      See Utilities for more information about the ObjectUseCountCollectRate field.

  • When a high amount of activity occurs on a set of database objects.

    Flushing the cache based on high activity is necessary to avoid accumulating stale counts in DBC.ObjectUsage. Fresh use counts are important for determining when statistics need to be recollected.

    High activity cache flushing is particularly useful after bulk load jobs where table cardinalities can change radically in a short period of time. For example, the OUC cache is flushed immediately after FastLoad and MultiLoad jobs complete.

  • When the Optimizer makes a specific request to flush the cache.

    This is referred to as on-demand flushing.