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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, 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-27 02:43:42
Message-ID: 1683251.1622083422@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> That's not *too* bad, but also not nothing....

The memsets seem to be easy to get rid of. memset the array
to zeroes *once* before entering the per-tuple loop. Then,
in the loop that looks for stuff to pfree, reset any entries
that are found to be set, thereby returning the array to all
zeroes for the next iteration.

I"m having a hard time though believing that the memset is the
main problem. I'd think the pfree search loop is at least as
expensive. Maybe skip that when not useful, by having a single
bool flag remembering whether any columns got detoasted in this
row?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message houzj.fnst@fujitsu.com 2021-05-27 02:47:25 RE: Skip partition tuple routing with constant partition key
Previous Message Ajin Cherian 2021-05-27 02:35:21 Re: [HACKERS] logical decoding of two-phase transactions