ALTER STREAM
Currently we don't recommend to alter the schema of streams in Timeplus. You can modify the retention policy for historical store via MODIFY TTL and modify the retention policy for streaming storage via MODIFY SETTING.
You can also use ALTER VIEW to modify the settings of materialized views (only available in Timeplus Enterprise).
MODIFY TTL
You can add or modify the retention policy. e.g.
ALTER STREAM stream_name MODIFY TTL
to_datetime(created_at) + INTERVAL 48 HOUR
MODIFY SETTING
You can add or modify the retention policy for streaming storage. e.g.
ALTER STREAM stream_name MODIFY SETTING
logstore_retention_ms = ...,
logstore_retention_bytes = ...;
MODIFY QUERY SETTING
This feature is available in Timeplus Enterprise v2.2.8 or above. Not available in Timeplus Proton.
Please use ALTER VIEW for this use cases. Altering views or materialized views will be depreicated and removed from the ALTER STREAM
SQL command.
By default, the checkpoint will be updated every 15 minutes for materialized views. You can change the checkpoint interval without recreating the materialized views.
ALTER STREAM mv_with_inner_stream MODIFY QUERY SETTING checkpoint_interval=600
RESET QUERY SETTING
This feature is available in Timeplus Enterprise v2.2.8 or above. Not available in Timeplus Proton.
Please use ALTER VIEW for this use cases. Altering views or materialized views will be depreicated and removed from the ALTER STREAM
SQL command.
By default, the checkpoint will be updated every 15 minutes for materialized views. After you change the interval you can reset it.
ALTER STREAM mv_with_inner_stream RESET QUERY SETTING checkpoint_interval
See also
- CREATE STREAM - Create streams
- CREATE MATERIALIZED VIEW - Create materialized views
- ALTER VIEW - Alter views or materialized views
- DROP STREAM - Drop streams
- DROP VIEW - Drop materialized views