pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <dgrowleyml@gmail.com>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: David Rowley <drowley@postgresql.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Optimize tuple deformation
Date: Wed, 7 Oct 2026 21:54:39 +1300
Message-ID: <CAApHDvoLatLLOtyCjPT4uAOyuEnHTVmqDvWmMWToNeVNrgWLbg@mail.gmail.com> (raw)
In-Reply-To: <10cee1a3-3e27-4a27-83aa-acecb757640e@eisentraut.org>
References: <E1w1uI5-000LSw-1l@gemulon.postgresql.org>
	<10cee1a3-3e27-4a27-83aa-acecb757640e@eisentraut.org>

On Wed, 7 Oct 2026 at 19:31, Peter Eisentraut <peter@eisentraut.org> wrote:
>
> On 15.03.26 23:50, David Rowley wrote:
> > Optimize tuple deformation
>
> This commit c456e391138 changed in slot_deform_heap_tuple() the type of
> attnum from int to size_t, which seems unusual and doesn't fit with the
> surrounding code.  Could you check whether that was intentional?

It was done to work around a problem with gcc where it was refusing to
index the CompactAttribute array by adding 8 to the previous address
to get the address of the next element. Instead, it was doing LEA on
each loop, which was slower due to shift and add rather than just add.
The best I could figure out is that gcc didn't want to optimise to use
LEA due to concerns about the integer wrapping around, which, if it
did, would be a different address than doing 2^31 adds on a 64-bit
pointer.

David






view thread (6+ messages)  latest in thread

Message-ID: <CAApHDvoLatLLOtyCjPT4uAOyuEnHTVmqDvWmMWToNeVNrgWLbg@mail.gmail.com>
Permalink:  ../CAApHDvoLatLLOtyCjPT4uAOyuEnHTVmqDvWmMWToNeVNrgWLbg@mail.gmail.com/
Also on:    postgresql.org/message-id/CAApHDvoLatLLOtyCjPT4uAOyuEnHTVmqDvWmMWToNeVNrgWLbg@mail.gmail.com

 · 

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-committers@postgresql.org
  Cc: dgrowleyml@gmail.com, peter@eisentraut.org, drowley@postgresql.org
  Subject: Re: pgsql: Optimize tuple deformation
  In-Reply-To: <CAApHDvoLatLLOtyCjPT4uAOyuEnHTVmqDvWmMWToNeVNrgWLbg@mail.gmail.com>
  References: <E1w1uI5-000LSw-1l@gemulon.postgresql.org> <10cee1a3-3e27-4a27-83aa-acecb757640e@eisentraut.org> <CAApHDvoLatLLOtyCjPT4uAOyuEnHTVmqDvWmMWToNeVNrgWLbg@mail.gmail.com>

* 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