Cloudscape Properties
Page 23 of 47

cloudscape.language.stalePlanCheckInterval

Function

Determines how many times Cloudscape should execute a statement before checking whether its plan is stale. When a statement is stale, Cloudscape invalidates the statement, which causes automatic recompilation the next time the statement is executed. Automatic invalidation is useful in situations when the amount of data in a table changes considerably during a single session of Cloudscape.

To read about when a statement is considered stale, see When a Change in Table Makes a Plan Stale.

For example, for a SELECT statement against an empty table, Cloudscape chooses to do a table scan instead of using an applicable index. However, as the table grows, at some point it becomes more efficient for Cloudscape to use an index to access the data. If the statement remains open, or if it is retrieved out of the statement cache or it is a stored prepared statement, however, Cloudscape continues to use the same query plan unless the statement is recompiled.

Setting the value of this property to 5 means that Cloudscape checks whether to invalidate a statement's plan after each 5 executions of the statement; setting the value of this property to 6 means that Cloudscape checks whether invalidates a statement's plan after every six executions of the statement, and so on.

To turn off automatic invalidation of statement plans, set this property to the maximum integer value (2147483647).

For more explanation, see Understand When Statements Go Stale.

Default

100.

Minimum Value

5

Maximum Value

java.lang.Integer.MAX_VALUE

Example

-- system -wide property
cloudscape.language.stalePlanCheckInterval=40

-- database-wide property
CALL PropertyInfo.setDatabaseProperty(
    'cloudscape.language.stalePlanCheckInterval',
    '40')

-- publishing a database-wide property
CREATE PUBLICATION APub
ADD TARGET DATABASE PROPERTY
cloudscape.language.stalePlanCheckInterval=
    '40'

Scope

system-wide

database-wide (publishable)

Dynamic or Static

Dynamic; the change takes effect immediately. For information about dynamic changes to properties, see Dynamic or Static Changes to Properties.