ttAgingTableLRUConfig
The ttAgingTableLRUConfig
procedure sets the Least Recently Used (LRU) aging attributes based on the number of rows per table, giving you control over how many rows delete. You can use it on regular and cache tables defined with an LRU aging policy.
LRU aging enables you to maintain the amount of memory used in a TimesTen database within a specified threshold by deleting the least recently used data. Data is removed if thresholds are reached based on rows for specified tables and on cache instances when applied to specified cache groups. You can limit the number of rows deleted from a specified table by setting row thresholds for the table.
For cache groups, LRU aging is defined at the root table for the entire cache instance. LRU aging can be defined for all cache group types except for explicitly loaded autorefresh cache groups. LRU aging is defined by default on dynamic cache groups. For explicitly loaded cache groups, use time-based aging.
For cache tables, the aging policy is defined on the root table but
applies to all tables in the cache group. LRU aging automatically deletes rows from
child tables. The aging policy is defined on tables when they are created or
altered, using the CREATE TABLE
or ALTER TABLE
SQL
statements.
If both LowRowsThreshold
and
HighRowsThreshold
are set to zero, table based LRU aging is
disabled for this table. LRU aging on this table is switched to be based on the
permanent memory in use threshold.
Required Privileges
This procedure requires no privilege to query the current values. It
requires the ADMIN
privilege to change the current values.
Usage in TimesTen Scaleout and TimesTen Classic
This procedure is supported in TimesTen Classic but not supported in TimesTen Scaleout.Related Views
This procedure has no related views.
Syntax
ttAgingTableLRUConfig(tblOwner, tblName, [LowRowsThreshHold], [HighRowsThreshHold], [AgingCycle])
Parameters
ttAgingTableLRUConfig
has these optional
parameters:
Parameter | Type | Description |
---|---|---|
|
|
TimesTen table or cache group owner. |
|
|
Name of an application table. Provide the cache root table for a cache group. |
|
|
Sets, displays or resets the number of the rows at
which LRU aging is deactivated. LRU aging stops when the number
of rows reaches |
|
|
Sets, displays or resets the number of the rows at
which LRU aging is activated. LRU aging starts when the number
of rows reaches |
|
|
Sets, displays or resets the number of minutes between aging cycles, specified in minutes. Default is 1 minute. If you use this procedure to change the aging cycle, the cycle is reset based on the time that this procedure is called. For example, if you call this procedure at 12:00 p.m. and specify a cycle of 15 minutes, aging occurs at 12:15, 12:30, 12:45, and so on. If the cycle is set to a value of
|
Result Set
ttAgingTableLRUConfig
returns these results:
Column | Type | Description |
---|---|---|
|
|
TimesTen table or cache group owner. |
|
|
Name of an application table or cache root table. |
|
|
The number of the rows at which LRU aging is deactivated. |
|
|
The number of the rows at which LRU aging is activated. |
|
|
The current setting for the number of minutes between aging cycles, specified in minutes. |
Examples
The following example sets the aging threshold for rows in the
user1.table1
table to a low threshold of 10K rows and a high
threshold of 100K rows. The aging cycle is set to run at the default of once every
minute.
Command> Call ttAgingTableLRUConfig('user1', 'table1', 10000, 100000); < USER1, TABLE1, 10000, 100000, 1 > 1 row found.
The following example sets the aging threshold for rows in the
user1.table1
table to a low threshold of 5K rows and a high
threshold of 12K rows. The aging cycle is set to run once every two minutes.
Command> Call ttAgingTableLRUConfig('user1', 'table1', 5000, 12000, 2); < USER1, TABLE1, 10000, 100000, 0 > 1 row found.
The following example turns off aging by setting the low and high thresholds to zero.
Command> Call ttAgingTableLRUConfig('user1', 'table1', 0, 0); < USER1, TABLE1, 0, 0, 1 > 1 row found.
You can retrieve the threshold settings by running the built-in procedure with just the schema owner and table name.
Command> Call ttAgingTableLRUConfig('user1', 'table1'); < USER1, TABLE1, 10000, 100000, 1 > 1 row found.
Note:
The values of this procedure are persistent, even across system failures.
If no parameters are supplied, this procedure only returns the current LRU aging attribute settings.
See Also
- ttAgingLRUConfig
- ttAgingScheduleNow
- Usage-Based Aging in the Oracle TimesTen In-Memory Database Operations Guide