Skip Headers
Oracle® TimesTen In-Memory Database Reference
Release 11.2.1

Part Number E13069-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

ttOptSetColIntvlStats

Description

Modifies the statistics for the specified columns with interval information. This procedure allows an application to set statistics manually rather than have TimesTen automatically compute them. This feature is useful for preparing commands before the data has been inserted or for seeing how table characteristics can affect the choice of execution plan. This procedure modifies the relevant row(s) in the COL_STATS system table.

Because this procedure can be used before any data are in the table, the values specified do not need to bear any relation to the actual values, although some basic validity checking is performed.

Required privilege

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

Syntax

ttOptSetColIntvlStats('tblName', 'colName', invalidate, (stats))

Parameters

ttOptSetColIntvlStats has these parameters:

Parameter Type Description
tblName TT_CHAR(61) NOT NULL Name of an application table. Can include table owner.
colName TT_CHAR(30) NOT NULL Name of a column in that 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 re-executed. This includes commands prepared by other users. If invalidate is 0, the statistics are not considered to have been modified and existing commands are not reprepared.
stats VARBINARY (409600) NOT NULL Sets stats for the column, using the format:

(numInterval integer, numNull integer, totUniq integer, totTups integer,

/* information for interval 1 */

(numUniq integer, numTups integer, frequency of most occurred value integer, minVal, maxVal, modVal),

/* information for interval 2 */...)


Result set

ttOptSetColIntvlStats returns no results.

Example

To set the following statistics for column t1.x1:

Use the statement:

CALLttOptSetColIntvlStats('t1', 'x1', 1, (2, 10, 10, 100, (4, 40, 10, 1, 10, 5), (4, 20, 20, 11, 20, 15)));

Notes

The minimum and maximum values in the interval need to be given as VARBINARY. NULL values are not permitted as minimum or maximum values. The value is stored in the platform-specific endian format.

See also


ttOptEstimateStats
ttOptGetColStats
ttOptSetColStats
ttOptSetTblStats
ttOptUpdateStats