You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose retention is set to 4 months for a monthly partitioned table foo.
Suppose run_maintenance fails to run for whatever reason and as a consequence foo has only a very old partition, say, foo_p20010101.
When run_maintenance runs again in 2024 it will create lots of partitions.
The vast majority of them will be expired at the subsequent run.
Would it make sense to not create those in the first place?
Perhaps the timestamp to start creating partitions from should be something like MAX(NOW() - retention, last_partition_timestamp)?
The text was updated successfully, but these errors were encountered:
nicolagi
added a commit
to nicolagi/pg_partman
that referenced
this issue
Apr 11, 2024
I realized this requires tests and possibly other changes, but it's just a start to make the proposal from the pgpartman#649 more concrete.
I did try this and works for my use case.
Suppose retention is set to 4 months for a monthly partitioned table
foo
.Suppose
run_maintenance
fails to run for whatever reason and as a consequencefoo
has only a very old partition, say,foo_p20010101
.When
run_maintenance
runs again in 2024 it will create lots of partitions.The vast majority of them will be expired at the subsequent run.
Would it make sense to not create those in the first place?
Perhaps the timestamp to start creating partitions from should be something like
MAX(NOW() - retention, last_partition_timestamp)
?The text was updated successfully, but these errors were encountered: