Top
Enterprise Postgres 18 for Kubernetes User's Guide

4.16 Backing Up Statistics

In case the query plan becomes unstable, you can periodically backup the statistics using pg_dbms_stats. Set spec.fep.backupStats.enable to true and set the backup to spec.fep.backupStats.scheduleN (N is an integer) in the FEPClsuter custom resource. Note that spec.fep.backupStats.enable defaults to true.

The following are the configurable items.

The example below is a setting to take a backup of mydb every day at 20:00, and at the same time delete the backup from 5 days ago.

Example) Definition example of FEPCluster custom resource

spec:
  fep:
    backupStats: 
      enable: true
      schedule1: 
        enable: true
        backupSchedule: "0 20 * * *" 
        targetDb: mydb
        retention: 5
        comment: "mydbBackup"

Additionally, if there is no backup definition in spec.fep.backupStats.schedule1 when building FEPCluster for the first time, the backup definition will be defined in spec.fep.backupStats.schedule1 of the FEPCluster custom resource with the following settings by default.

Schedule: 23:30 every day

Target: All databases

Retention: Statistics backed up in that database older than 7 days will be deleted.

Comment: "FepDefaultBackup"

spec:
  fep:
    backupStats: 
      enable: true
      schedule1: 
        enable: true
        backupSchedule: "30 23 * * *"
        retention: 7
        comment: "FepDefaultBackup"

If you do not want to perform scheduled backups, set spec.fep.backupStats.scheduleN.enable to false. Also, if you do not want to perform all backups, set spec.fep.backupStats.enable to false.