Skip to main content
Configure automated scheduling using TimescaleDB’s job scheduling system.
  • Allow periodic execution of the vectorizer to process new or updated data
  • Provide fine-grained control over when and how often the vectorizer runs

Samples

Basic usage

Run every 5 minutes (default).
SELECT ai.create_vectorizer(
    'my_table'::regclass,
    scheduling => ai.scheduling_timescaledb(),
    -- other parameters...
);

Custom interval

Run every hour.
SELECT ai.create_vectorizer(
    'my_table'::regclass,
    scheduling => ai.scheduling_timescaledb(interval '1 hour'),
    -- other parameters...
);

Specific start time and timezone

SELECT ai.create_vectorizer(
    'my_table'::regclass,
    scheduling => ai.scheduling_timescaledb(
        interval '30 minutes',
        initial_start => '2024-01-01 00:00:00'::timestamptz,
        timezone => 'America/New_York'
    ),
    -- other parameters...
);

Fixed schedule

SELECT ai.create_vectorizer(
    'my_table'::regclass,
    scheduling => ai.scheduling_timescaledb(
        interval '1 day',
        fixed_schedule => true,
        timezone => 'UTC'
    ),
    -- other parameters...
);

Arguments

NameTypeDefaultRequiredDescription
schedule_intervalinterval’10m’Set how frequently the vectorizer checks for new or updated data to process
initial_starttimestamptz-Delay the start of scheduling. This is useful for coordinating with other system processes or maintenance windows
fixed_schedulebool-Set to true to use a fixed schedule such as every day at midnight. Set to false for a sliding window such as every 24 hours from the last run
timezonetext-Set the timezone this schedule operates in. This ensures that schedules are interpreted correctly, especially important for fixed schedules or when coordinating with business hours

Returns

A JSON configuration object that you can use in ai.create_vectorizer.