Leonardo M. Ramé writes:
> A customer of mine asked me to periodically delete old, unneeded records
> containing ByteA fields, because he think it will reduce the database
> size on disk. Is this true?.
No.
> For example, in Firebird, the database size
> is not reduced until you do a Backup-Restore of the database.
Not sure about ByteA, but in general... in potgres you need to do that or a
vacuum full.. or copy all the data of the table into a new table and rename.
Having said that.. if you delete old rows and do a vacuum and/or have
autovacuum enabled the space of those old rows can be re-used, slowing down
the growth of the table. So yes, deleting old rows and doing a vacuum is a
good thing.. but no I don't believe it will reduce database size.
I say "don't believe" because I don't recall if byteA was stored in the
table itself or was stored outside using TOAST.. so I am not sure about
how/when space is released for it.