0

Is there way we can get the table size and DB size growth from last one month day-wise?

We are able to give the current size of DB and table size.

1

The only way you can do it properly is storing those two numbers at appropriate intervals (say, daily) somewhere. There is no history kept.

With some limitations, you can also compare the sizes of your daily backups, until you start collecting the above mentioned metrics.

1

If you have a base backup from more than a month ago, and all the archived WAL files, then you can spin up a new server and do PITR ending at each day, and take the sizes at each day. You will need to set recovery_target_time and perhaps recovery_target_timeline. You will probably also want to use pause_at_recovery_target or recovery_target_action (depending on what version you have) so that you can resume PITR from where you left off for the next day, rather than having to restart from scratch each day.

This is a rather heavy-handed way to do things. Going forward, you should just schedule a job to take the sizes each day and store them someplace, either inside the database or outside.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.