STS_SubtrackAlterProcessing function

The STS_SubtrackAlterProcessing function adds, removes, or changes the Scheduler task for the specified subtrack.

Syntax

STS_SubtrackAlterProcessing(
   subtrack_name                 VARCHAR(128),
   flags                         INTEGER DEFAULT 1,
   task_nschsessions             INTEGER DEFAULT 1,
   task_frequency                INTERVAL DAY TO SECOND DEFAULT DEFAULT NULL 
                                                     DEFAULT "0 01:00:00",
   task_start_time               DATETIME HOUR TO SECOND DEFAULT NULL,
   task_data_interval_to_process INTERVAL DAY TO SECOND DEFAULT NULL)
returns INTEGER
subtrack_name
The name of the subtrack table.
flags
What to do to the Scheduler task:
1 = Default. Create or replace the Scheduler task.
2 = Delete any existing Scheduler task.
task_nschsessions
The number of Scheduler tasks to start to update the index in parallel. Default is 1 if the flags parameter is set to 1.
task_frequency
How frequently to index new data with the Scheduler task. Default is every hour.
task_start_time
The first time to start the Schedule task. Default is NULL, which means to start the task when the STS_SubtrackAlterProcessing function is run.
task_data_interval_to_process
The time interval in the time series to process each time that the Scheduler task is run. If this value is not the same as the value of the task_frequency parameter, the index might be incomplete. Default is that new data is subject to the ts_data_lag_to_current setting, as specified by the STS_SubtrackCreate or the STS_SubtrackAlterLagToCurrent function.

Usage

Run the STS_SubtrackAlterProcessing function to change the Scheduler task for a subtrack table. For example, you can speed up spatiotemporal indexing by setting the task_nschsessions parameter to a larger number.

If you are creating or updating a Scheduler task by setting the flags parameter to 1, you must include values for the four parameters that configure the task properties. If you are deleting the Scheduler task by setting the flags parameter to 2, do not include the four task parameters.

Returns

0 = The Scheduler task is created, removed, or updated.

An exception = An error.

Example: Change the Scheduler task

The following statement updates the existing Scheduler task for the ts_vehicle_subtrack subtrack table:

BEGIN WORK;
EXECUTE FUNCTION STS_SubtrackAlterProcessing(
     'ts_vehicle_subtrack', 
     1,
     3,
     '0 02:00:00'::INTERVAL DAY TO SECOND,
     NULL::HOUR TO SECOND,
     NULL::INTERVAL DAY TO SECOND);
COMMIT WORK;

Three Scheduler tasks are started that run every two hours.

Example: Delete the Scheduler task

The following statement deletes the existing Scheduler task for the ts_vehicle_subtrack subtrack table:

BEGIN WORK;
EXECUTE FUNCTION STS_SubtrackAlterProcessing(
     'ts_vehicle_subtrack', 2);
COMMIT WORK;

Example: Change the Scheduler task

The following statement changes the Scheduler task for the ts_vehicle_subtrack subtrack table:

BEGIN WORK;
EXECUTE FUNCTION STS_SubtrackAlterProcessing('t_vehicle_subtrack', 1,
        '2014-01-01 00:00:00', '1 00:00:00',
        2, '0 01:15:00', '12:30:00', '1 12:00:00');
COMMIT WORK;

The first time stamp to index is 2014-01-01 00:00:00. The indexing lag time is one day. Two Scheduler tasks are started that run every one hour and 15 minutes, first start at 12:30, and process one and a half days of data.