Raw event retention
Raw changelog events can grow quickly. For now, manage raw-event cleanup manually in your Postgres provider or with direct database access.
The storage window is your operational choice because Orloi writes to your Postgres database.
Recommended flow
- Choose a cutoff, usually raw events older than 90 days.
- Preview the matching raw events.
- Export matching rows with provider-native tooling or
psql. - Confirm the export completed and is stored somewhere durable.
- Delete only the exported raw rows and their metric provenance links for this engine.
- Run provider-specific maintenance such as vacuuming if needed.
What remains available
- Compacted events
- Metric values and metric history charts
- Reports
- Saved process and activity summaries
These layers remain useful for reading historical summaries and trends, but they are no longer enough to fully recompute everything from source after the raw inputs have been deleted.
What is removed from hot storage
- Full raw source event detail for deleted rows
- Exact recomputation for periods whose raw input was deleted
- Metric drill-down rows that still depend on raw event records
If you rely on audit-level detail or exact historical recomputation, export raw events before deletion and keep the archive somewhere durable.
Preview template
Check the exact row count and timestamp range before export.
SELECT
count(*) AS raw_event_count,
min(event_timestamp) AS oldest_event_timestamp,
max(event_timestamp) AS newest_event_timestamp
FROM orloi.data_changelog_raw_events
WHERE sync_id = '<engine_sync_id>'
AND event_timestamp < '<cutoff_iso_timestamp>';Supabase export query
In Supabase, run a plain SELECT, then export the query results from the dashboard. This is suitable for smaller exports.
SELECT *
FROM orloi.data_changelog_raw_events
WHERE sync_id = '<engine_sync_id>'
AND event_timestamp < '<cutoff_iso_timestamp>'
ORDER BY event_timestamp, id;Direct database export
For larger exports, use direct database access from your local environment or another controlled machine.
\copy (
SELECT row_to_json(raw_event)
FROM (
SELECT *
FROM orloi.data_changelog_raw_events
WHERE sync_id = '<engine_sync_id>'
AND event_timestamp < '<cutoff_iso_timestamp>'
ORDER BY event_timestamp, id
) raw_event
) TO 'orloi-raw-events.jsonl';Delete template
Run deletion only after the export has succeeded. Keep the same sync_id and cutoff used for export.
Metric values remain, but metric drill-down links to deleted raw events are removed.
WITH raw_events_to_delete AS (
SELECT id
FROM orloi.data_changelog_raw_events
WHERE sync_id = '<engine_sync_id>'
AND event_timestamp < '<cutoff_iso_timestamp>'
),
deleted_metric_provenance AS (
DELETE FROM orloi.data_changelog_metric_value_events
WHERE raw_event_id IN (SELECT id FROM raw_events_to_delete)
)
DELETE FROM orloi.data_changelog_raw_events
WHERE id IN (SELECT id FROM raw_events_to_delete);