ttOptSetTblStats

This procedure modifies the statistics for the specified table. This procedure enables an application to set statistics explicitly rather than have TimesTen automatically compute them.

Required Privilege

This procedure requires no privilege (if owner) or ALTER ANY TABLE privilege (if not owner).

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure runs on all elements in the grid.

Related Views

This procedure has no related views.

Syntax

ttOptSetTblStats('tblName', numRows, invalidate)

Parameters

ttOptSetTblStats has these parameters:

Parameter Type Description

tblName

TT_CHAR(61) NOT NULL

Name of an application table. Can include table owner.

Using a synonym to specify a table name is not supported.

num_Rows

TT_INTEGER NOT NULL

Number of rows in the table.

invalidate

TT_INTEGER

0 (no) or 1 (yes). If invalidate is 1, all commands that reference the affected tables are automatically prepared again when rerun, including commands prepared by other users. If invalidate is 0, the statistics are not considered to have been modified and existing commands are not reprepared.

Result Set

ttOptSetTblStats returns no results.

Examples

CALL ttOptSetTblStats ( 'ACCTS', 10000, 0 );

Note:

This feature is useful for preparing commands before the data has been inserted or for seeing how table size can affect the choice of an execution plan. Because the command can be used before any data is in the table, the values specified do not need to bear any relation to the actual values. This procedure modifies the relevant row(s) in the TBL_STATS system table. See SYS.TBL_STATS in Oracle TimesTen In-Memory Database System Tables and Views Reference.