Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcSKf-000EL6-BB for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Feb 2024 15:46:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rcSJf-000Wcq-Ah for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Feb 2024 15:45:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcSJf-000Wch-1M for pgsql-hackers@lists.postgresql.org; Tue, 20 Feb 2024 15:45:55 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcSJd-0001lW-4g for pgsql-hackers@lists.postgresql.org; Tue, 20 Feb 2024 15:45:54 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 41KFjp2n184954; Tue, 20 Feb 2024 10:45:51 -0500 From: Tom Lane To: Quan Zongliang cc: pgsql-hackers@lists.postgresql.org Subject: Re: Change the bool member of the Query structure to bits In-reply-to: References: Comments: In-reply-to Quan Zongliang message dated "Tue, 20 Feb 2024 18:07:46 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <184952.1708443951.1@sss.pgh.pa.us> Date: Tue, 20 Feb 2024 10:45:51 -0500 Message-ID: <184953.1708443951@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Quan Zongliang writes: > The Query structure has an increasing number of bool attributes. This is > likely to increase in the future. And they have the same properties. > Wouldn't it be better to store them in bits? Common statements don't use > them, so they have little impact. This also saves memory space. I'm -1 on that, for three reasons: * The amount of space saved is quite negligible. If queries had many Query structs then it could matter, but they don't. * This causes enough code churn to create a headache for back-patching. * This'll completely destroy the readability of these flags in pprint output. I'm not greatly in love with the macro layer you propose, either, but those details don't matter because I think we should just leave well enough alone. regards, tom lane