feat: introduce configurable future partition buffer and add monitoring for future partitions.

This commit is contained in:
Maksym Buz
2026-02-19 17:27:31 +00:00
parent bd15e707cc
commit 99e25f2efb
5 changed files with 21 additions and 11 deletions

View File

@@ -10,6 +10,12 @@ SELECT
c.period,
c.keep_history,
count(child.relname) AS partition_count,
count(child.relname) FILTER (
WHERE
(c.period = 'day' AND child.relname > (parent.relname || '_p' || to_char(now(), 'YYYYMMDD')))
OR
(c.period = 'month' AND child.relname > (parent.relname || '_p' || to_char(now(), 'YYYYMM')))
) AS future_partitions,
pg_size_pretty(sum(pg_total_relation_size(child.oid))) AS total_size,
min(child.relname) AS oldest_partition,
max(child.relname) AS newest_partition,