Re: effects of nullifying bytea column on storage

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: David Gauthier <dfgpostgres(at)gmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: effects of nullifying bytea column on storage
Date: 2022-05-12 00:05:17
Message-ID: CAKFQuwZqG-tDyK7YTeBVyG26LcegeX46U_Sw09Q-v6VhsBjqPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday, May 11, 2022, David Gauthier <dfgpostgres(at)gmail(dot)com> wrote:

> Hi:
> psql (11.5, server 11.3) on linux
>
> I have a table with a bytea column which, of course, contains binary
> data. After 60 days, I no longer need the binary data but want to retain
> the rest of the record. Of course it's easy to just update the bytea
> column to null for the older records. But I can almost imagine this record
> on disk with a big "hole" in the middle where the bytea data used to be.
> Is there a PG daemon (the vacuum ?) that will "heal the hole" in time?
>
>
The freshly written record will not have a hole - either by virtue of
variable width fields taking up basically their actual data space and also
the fact that null is treated specially in the record format.

For the old row, yes you should read up on the how and why of the vacuum
command.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Amit Kapila 2022-05-12 02:54:33 Re: Support logical replication of DDLs
Previous Message David Gauthier 2022-05-12 00:01:36 effects of nullifying bytea column on storage