pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Dilip Kumar <dilipbalaut@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Robert Haas <robertmhaas@gmail.com>
Subject: Re: Move pg_attribute.attcompression to earlier in struct for reduced size?
Date: Wed, 26 May 2021 22:43:42 -0400
Message-ID: <1683251.1622083422@sss.pgh.pa.us> (raw)
In-Reply-To: <20210527021402.b5n2sqw66y2fd6fl@alap3.anarazel.de>
References: <3962395.1621609263@sss.pgh.pa.us>
	<20210521211929.pcehg6f23icwstdb@alap3.anarazel.de>
	<YKsm7qkz+Cq3C3mr@paquier.xyz>
	<CAFiTN-uLQCRLatapZhEaNGH9njY=LndyXJux7H9YCfT9RcE7gA@mail.gmail.com>
	<YKtpZI4PBpVG3ryH@paquier.xyz>
	<CAFiTN-vpHrCzdeyKxpoPViyJCZZx-h8KghQJFyxZd7+Dys6Cow@mail.gmail.com>
	<YKyPM6UC+tBHEuxo@paquier.xyz>
	<20210527003144.xxqppojoiwurc2iz@alap3.anarazel.de>
	<1677691.1622075746@sss.pgh.pa.us>
	<20210527015415.ctuj4yrwnjip5kve@alap3.anarazel.de>
	<20210527021402.b5n2sqw66y2fd6fl@alap3.anarazel.de>

Andres Freund <andres@anarazel.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





view thread (73+ messages)  latest in thread

Message-ID: <1683251.1622083422@sss.pgh.pa.us>
Permalink:  ../1683251.1622083422@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1683251.1622083422@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, michael@paquier.xyz, dilipbalaut@gmail.com, robertmhaas@gmail.com
  Subject: Re: Move pg_attribute.attcompression to earlier in struct for reduced size?
  In-Reply-To: <1683251.1622083422@sss.pgh.pa.us>
  References: <3962395.1621609263@sss.pgh.pa.us> <20210521211929.pcehg6f23icwstdb@alap3.anarazel.de> <YKsm7qkz+Cq3C3mr@paquier.xyz> <CAFiTN-uLQCRLatapZhEaNGH9njY=LndyXJux7H9YCfT9RcE7gA@mail.gmail.com> <YKtpZI4PBpVG3ryH@paquier.xyz> <CAFiTN-vpHrCzdeyKxpoPViyJCZZx-h8KghQJFyxZd7+Dys6Cow@mail.gmail.com> <YKyPM6UC+tBHEuxo@paquier.xyz> <20210527003144.xxqppojoiwurc2iz@alap3.anarazel.de> <1677691.1622075746@sss.pgh.pa.us> <20210527015415.ctuj4yrwnjip5kve@alap3.anarazel.de> <20210527021402.b5n2sqw66y2fd6fl@alap3.anarazel.de> <1683251.1622083422@sss.pgh.pa.us>

* 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