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 1rcZnq-000rHu-10 for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Feb 2024 23:45:34 +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 1rcZno-001uVy-93 for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Feb 2024 23:45:32 +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 1rcZnn-001uVq-DU for pgsql-hackers@lists.postgresql.org; Tue, 20 Feb 2024 23:45:32 +0000 Received: from mail-178177.yeah.net ([123.58.178.177]) by magus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rcZnj-00052s-2i for pgsql-hackers@lists.postgresql.org; Tue, 20 Feb 2024 23:45:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yeah.net; s=s110527; h=Message-ID:Date:MIME-Version:Subject:From: Content-Type; bh=IPBlKRoShFHnBswqRrAkjNE4trepk8AJVDCW/knFlHQ=; b=lgMwSv7j3buhcq8sAE98QKLEZ6ZDQvYXbn12D/DHQP+x+B5pUn8V3z64EJux2T +LOJsFZomfiAnukMEXuNQumvWciooiMhxJ2KXqIg3nKrEywRlqH9qocjQlgxGAHy Tdy+zxhqfiEauYRDtc7OdmPYAv4ahi1KP0ukEksnO44lY= Received: from [IPV6:2408:8210:2410:aeb0:14d5:c781:675f:31e3] (unknown [2408:8210:2410:aeb0:14d5:c781:675f:31e3]) by smtp3 (Coremail) with SMTP id sVUQrAD3X+CSOdVlj80oAA--.22867S2; Wed, 21 Feb 2024 07:45:22 +0800 (CST) Message-ID: Date: Wed, 21 Feb 2024 07:45:22 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Change the bool member of the Query structure to bits Content-Language: en-US To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org References: <184953.1708443951@sss.pgh.pa.us> From: Quan Zongliang In-Reply-To: <184953.1708443951@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID:sVUQrAD3X+CSOdVlj80oAA--.22867S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrtw4Dtw1xKr45Jw1rtrWfAFb_yoWfArb_ur 9F9Fy0g395J3W7Xa1fGrn8Gr1xG3y7XFy5WrWDJF4Iq3W5Ar47AFsIkr13Ww4DX39FyF1Y gFnY93WxKw45WjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU1JDG5UUUUU== X-Originating-IP: [2408:8210:2410:aeb0:14d5:c781:675f:31e3] X-CM-SenderInfo: htxd06xrqjzxxdqjq5hhdkh0dhw/1tbiDRKKJFszXPxz4gAAso List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024/2/20 23:45, Tom Lane wrote: > 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 I get it. Withdraw.