ttOptCmdCacheInvalidate

This built-in procedure either forces a recompilation should a dependent command be invoked again, or removes such command from the cache and it must be re-prepared by the user.

Scenarios in which you may want to call this procedure include:

  • After all needed statistics have been collected.

  • When table cardinalities have been changed significantly.

The procedure either marks a command as needing recompilation or as invalidated.

Neither option stops execution of a command.

Required Privilege

This procedure requires the DDL privilege.

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 locally on the element from which it is called.

Related Views

This procedure has no related views.

Syntax

ttOptCmdCacheInvalidate('tblName', invalidate)

Parameters

ttOptCmdCacheInvalidate has these parameters:

Parameter Type Description

tblname

TT_CHAR(61)

The name of the table for which the dependent commands should be invalidated or recompiled.

invalidate

TT_INTEGER

Forces recompilation or invalidates the dependent commands.

1 - Indicates that the commands should be recompiled. The command is recompiled during its first use after calling this built-in procedure. (default)

2 - Indicates that the commands should be invalidated. The command is not reused or recompiled again. If you call the command after you have marked it for invalidation, TimesTen returns an error.

Result Set

ttOptCmdCacheInvalidate returns no results.

Examples

To recompile dependent commands on the table tab1, use:

CALL ttOptCmdCacheInvalidate ('tab1', 1);

To invalidate the dependent commands on table tab1, use:.

CALL ttOptCmdCacheInvalidate ('tab1', 2);