Re: Move pg_attribute.attcompression to earlier in struct for reduced size?

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Move pg_attribute.attcompression to earlier in struct for reduced size?
Date: 2021-05-24 06:02:22
Message-ID: CAFiTN-uLQCRLatapZhEaNGH9njY=LndyXJux7H9YCfT9RcE7gA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 24, 2021 at 9:39 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Fri, May 21, 2021 at 02:19:29PM -0700, Andres Freund wrote:
> > During VACUUM FULL reform_and_rewrite_tuple() detoasts the old value if
> > it was compressed with a different method, while in
> > TopTransactionContext. There's nothing freeing that until
> > TopTransactionContext ends - obviously not great for a large relation
> > being VACUUM FULLed.
>
> Yeah, that's not good. The confusion comes from the fact that we'd
> just overwrite the values without freeing them out if recompressed, so
> something like the attached would be fine?

/* Be sure to null out any dropped columns */
for (i = 0; i < newTupDesc->natts; i++)
{
+ tup_values[i] = values[i];
+
if (TupleDescAttr(newTupDesc, i)->attisdropped)
isnull[i] = true;

I think you don't need to initialize tup_values[i] with the
values[i];, other than that looks fine to me.

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-05-24 06:33:32 Re: Teaching users how they can get the most out of HOT in Postgres 14
Previous Message Dilip Kumar 2021-05-24 05:55:18 Re: Move pg_attribute.attcompression to earlier in struct for reduced size?