User-defined container pool policy

You can create a policy for inserting data into containers within a container pool.

The user-defined container policy you create must have one of the following function signatures.

Syntax

PolicyName(
      table_name lvarchar,
      column_name lvarchar,
      subtype lvarchar,
      irregular integer,
      user_data lvarchar
returns lvarchar;

PolicyName(
      table_name lvarchar,
      column_name lvarchar,
      subtype lvarchar,
      irregular integer,
returns lvarchar;
PolicyName
The name of the user-defined function.
table_name
The table into which the time series data is being inserted.
column_name
The name of the time series column into which data is being inserted.
subtype
The name of the TimeSeries subtype.
irregular
Whether the time series is regular (0) or irregular (1).
user_data
Optional argument for the name of the container pool.

Description

Write a container pool policy function to select containers in which to insert time series data. For example, the TSContainerPoolRoundRobin function inserts data into containers in a round-robin order. You can write a policy function to insert data into the container with the most free space or by using other criteria. You can either specify the name of the container pool with the user_data argument or include code for choosing the appropriate container pool in the policy function. The container pool must exist before you can insert data into it, and at least one container within the container pool must be configured for the same TimeSeries subtype as used by the data being inserted. Include the policy function in the container argument of an INSERT statement. The policy function returns container names to the INSERT statement in the order specified by the function.

Returns

The container name in which to store the time series value.


Copyright© 2018 HCL Technologies Limited