pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Move pg_attribute.attcompression to earlier in struct for reduced size?
Date: Wed, 9 Jun 2021 12:24:57 +0900
Message-ID: <YMA0iRYL49kdCCZu@paquier.xyz> (raw)
In-Reply-To: <202106081439.m2pwwk5yvcrd@alvherre.pgsql>
References: <YLw797TlZxbB0QHU@paquier.xyz>
	<202106081439.m2pwwk5yvcrd@alvherre.pgsql>

On Tue, Jun 08, 2021 at 10:39:24AM -0400, Alvaro Herrera wrote:
> My unverified guess is that this code causes too many pipeline stalls
> while executing the big per-column loop.  Maybe it would be better to
> scan the attribute array twice: one to collect all data from
> Form_pg_attribute for each column into nicely packed arrays, then in a
> second loop process all the recompressions together ... the idea being
> that the first loop can run without stalling.

You mean for attlen and attcompression, right?  I agree that it would
help.

A extra set of things worth it here would be to move the allocation
and memset(0) of values_free from reform_and_rewrite_tuple(), and do
the round of pfree() calls if at least one value has been detoasted.

> Maybe at this point reverting is the only solution.

That's a safe bet at this point.  It would be good to conclude this
one by beta2 IMO.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (73+ messages)  latest in thread

Message-ID: <YMA0iRYL49kdCCZu@paquier.xyz>
Permalink:  ../YMA0iRYL49kdCCZu@paquier.xyz/
Also on:    postgresql.org/message-id/YMA0iRYL49kdCCZu@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: michael@paquier.xyz, alvherre@alvh.no-ip.org, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, dilipbalaut@gmail.com, andres@anarazel.de
  Subject: Re: Move pg_attribute.attcompression to earlier in struct for reduced size?
  In-Reply-To: <YMA0iRYL49kdCCZu@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox