The object use count cache, or OUC cache, tracks object access use counts, UDI 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:
Because only table-level insert and delete UDI counts are needed for cardinality estimation, Teradata Database records that information in the OUC cache as INTEGER data. 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 Parser components populate the object use count cache with both object use count and UDI data.
This Parser component … |
Populates the OUC cache with this type of information … |
Red tree The red tree is the Parser tree output of the Resolver and the Query Rewrite subsystem. |
|
White tree The white tree is the Parser tree output of the Optimizer. |
|
Dispatcher The output of the Dispatcher is the AMP steps. |
Runtime data on the following step‑level operations. |
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:
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.
See Utilities for more information about the ObjectUseCountCollectRate field.
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. Because of this, Teradata Database always flushes the OUC cache immediately after high activity processes like FastLoad and MultiLoad jobs complete.
This is referred to as on‑demand flushing.