pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Cc: andres@anarazel.de
Cc: amitdkhan.pg@gmail.com
Cc: ashutosh.bapat@enterprisedb.com
Cc: pgsql-hackers@postgresql.org
Cc: robertmhaas@gmail.com
Cc: kommi.haribabu@gmail.com
Cc: alvherre@2ndquadrant.com
Cc: amit.kapila16@gmail.com
Subject: Re: TupleTableSlot abstraction
Date: Mon, 01 Oct 2018 22:21:58 -0400
Message-ID: <9677.1538446918@sss.pgh.pa.us> (raw)
In-Reply-To: <20181002.104132.151921239.horiguchi.kyotaro@lab.ntt.co.jp>
References: <CAFjFpRe1TZrDHwPq-EzTWd=N6keGNHj_+GWe_zyQ5ZooQ+4LeA@mail.gmail.com>
	<CAJ3gD9fLTn0U5N5iNPkSKFCWLDKfFO7AKq7L8ozxZ2QcuJEuiw@mail.gmail.com>
	<20180925234509.3hrrf6tmvy5tfith@alap3.anarazel.de>
	<20181002.104132.151921239.horiguchi.kyotaro@lab.ntt.co.jp>

Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes:
> At Tue, 25 Sep 2018 16:45:09 -0700, Andres Freund <andres@anarazel.de> wrote in <20180925234509.3hrrf6tmvy5tfith@alap3.anarazel.de>
>> On 2018-09-04 18:35:34 +0530, Amit Khandekar wrote:
>>> Pack the boolean members in TupleTableSlot into a 16 bit tts_flags.
>>> This reduces the size of TupleTableSlot since each bool member takes
>>> at least a byte on the platforms where bool is defined as a char.

> About bitfields, an advantage of it is debugger awareness. We
> don't need to look aside to the definitions of bitwise macros
> while using debugger. And the current code is preserved in
> appearance by using it.

FWIW, I would expect a change like this to be a net loss performance-wise
on most platforms.  Testing the contents of a byte-wide variable is pretty
cheap on any architecture invented later than ~ 1970.  Testing a bit,
though, requires a masking operation that is not free.  I am not seeing
how making TupleTableSlot a little smaller buys that back ... we don't
normally have that many active slots in a plan.

			regards, tom lane




view thread (50+ messages)  latest in thread

Message-ID: <9677.1538446918@sss.pgh.pa.us>
Permalink:  ../9677.1538446918@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9677.1538446918@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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, horiguchi.kyotaro@lab.ntt.co.jp, andres@anarazel.de, amitdkhan.pg@gmail.com, ashutosh.bapat@enterprisedb.com, robertmhaas@gmail.com, kommi.haribabu@gmail.com, alvherre@2ndquadrant.com, amit.kapila16@gmail.com
  Subject: Re: TupleTableSlot abstraction
  In-Reply-To: <9677.1538446918@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