Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g7AKC-0003DX-CH for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Oct 2018 02:22:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g7AKA-0002r3-DQ for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Oct 2018 02:22:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g7AKA-0002qw-6X for pgsql-hackers@lists.postgresql.org; Tue, 02 Oct 2018 02:22:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g7AK7-0008HR-CN for pgsql-hackers@postgresql.org; Tue, 02 Oct 2018 02:22:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w922LwDR009678; Mon, 1 Oct 2018 22:21:58 -0400 From: Tom Lane To: Kyotaro HORIGUCHI cc: andres@anarazel.de, amitdkhan.pg@gmail.com, ashutosh.bapat@enterprisedb.com, pgsql-hackers@postgresql.org, robertmhaas@gmail.com, kommi.haribabu@gmail.com, alvherre@2ndquadrant.com, amit.kapila16@gmail.com Subject: Re: TupleTableSlot abstraction In-reply-to: <20181002.104132.151921239.horiguchi.kyotaro@lab.ntt.co.jp> References: <20180925234509.3hrrf6tmvy5tfith@alap3.anarazel.de> <20181002.104132.151921239.horiguchi.kyotaro@lab.ntt.co.jp> Comments: In-reply-to Kyotaro HORIGUCHI message dated "Tue, 02 Oct 2018 10:41:32 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9676.1538446918.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 01 Oct 2018 22:21:58 -0400 Message-ID: <9677.1538446918@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Kyotaro HORIGUCHI writes: > At Tue, 25 Sep 2018 16:45:09 -0700, Andres Freund w= rote 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