Summary
Outpost's Postgres events and attempts tables are declared as range-partitioned on time, but only DEFAULT partitions are created.
We could not find any code that creates, rotates, or drops time-based Postgres partitions, nor any built-in Postgres retention mechanism. This leaves operators implementing retention externally with row-by-row DELETE, with the associated dead-tuple, vacuum, and index-maintenance overhead.
This appears to be an incomplete part of the intended Postgres design rather than a new feature request.
Evidence in the source
The Postgres schema already uses time-based partitioning:
PRIMARY KEY (time, id)
) PARTITION BY RANGE (time);
CREATE TABLE events_default PARTITION OF events DEFAULT;
The same pattern is used for attempts.
More importantly, internal/logstore/pglogstore/README.md:367-373 explicitly lists:
Easy data retention (drop old partitions)
as a benefit of the time-based partitioning design.
However, we could not find runtime or migration code that creates, attaches, detaches, or drops those partitions.
The retention documentation also appears unfinished: docs/content/self-hosting/guides/event-delivery-log.mdoc:8 currently contains:
Need to talk about data retention and retention policies.
Request
It would be great to complete the Postgres retention design by adding:
- Automatic time-range partition management — create future partitions and drop expired ones.
- A Postgres retention setting implemented on top of those partitions.
- A supported migration path for existing installations where data is already in the DEFAULT partitions.
- Documentation describing the intended Postgres retention model.
Questions
- Is Postgres partition lifecycle management already planned or tracked?
- Is there a recommended migration path for existing DEFAULT partitions?
- Until native retention exists, what retention approach do you recommend for Postgres?
Small unrelated finding
The primary-key index on attempts_default still appears to be named deliveries_default_pkey.
000005_denormalize_attempts.up.sql:59-60 renames the table and partition but apparently not the constraint-backing index. Harmless, but slightly confusing when inspecting pg_stat_user_indexes.
Summary
Outpost's Postgres
eventsandattemptstables are declared as range-partitioned ontime, but only DEFAULT partitions are created.We could not find any code that creates, rotates, or drops time-based Postgres partitions, nor any built-in Postgres retention mechanism. This leaves operators implementing retention externally with row-by-row
DELETE, with the associated dead-tuple, vacuum, and index-maintenance overhead.This appears to be an incomplete part of the intended Postgres design rather than a new feature request.
Evidence in the source
The Postgres schema already uses time-based partitioning:
The same pattern is used for
attempts.More importantly,
internal/logstore/pglogstore/README.md:367-373explicitly lists:as a benefit of the time-based partitioning design.
However, we could not find runtime or migration code that creates, attaches, detaches, or drops those partitions.
The retention documentation also appears unfinished:
docs/content/self-hosting/guides/event-delivery-log.mdoc:8currently contains:Request
It would be great to complete the Postgres retention design by adding:
Questions
Small unrelated finding
The primary-key index on
attempts_defaultstill appears to be nameddeliveries_default_pkey.000005_denormalize_attempts.up.sql:59-60renames the table and partition but apparently not the constraint-backing index. Harmless, but slightly confusing when inspectingpg_stat_user_indexes.