Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pckox-0000V7-Nz for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Mar 2023 10:26:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pckow-0003MZ-DG for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Mar 2023 10:26:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pckow-0003MQ-39 for pgsql-hackers@lists.postgresql.org; Thu, 16 Mar 2023 10:26:54 +0000 Received: from new3-smtp.messagingengine.com ([66.111.4.229]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pckos-0006M5-K1 for pgsql-hackers@postgresql.org; Thu, 16 Mar 2023 10:26:53 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id ACD50581FC4; Thu, 16 Mar 2023 06:26:48 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 16 Mar 2023 06:26:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1678962408; x=1678969608; bh=dT00E2yTGr4gSkOMz10ALcjwqr/uHONnStv Q7+suu+4=; b=uSlKL84wVCSon7czVWSVsIAJ88rW2Js4lOyrORwbsL1+wmOTcbY NsOkRIWoKFDjDfDH7ggD40gCHC8dc8VzHsBbEaGQ1zDrwnKSpaWQmU2yhoT8Ywrc NWG5k3SGbb/dyjRZbCC8/4pVAuvC0ULDGDgMV3GuHAoXT3UqlcmrF05APid/bVFV Fd//X+d1WFLsg8+g9TFXUPkHp205aZpLIMpINcuMuEAozjLc+Gc69+YalgQC41bB yBGLwCNhQ5TbHCApEosyAQOyohY8emZtwjdIjBUsWP8YV3lu6CDFRNC8WrOgRXe3 wvndsHPIHBlHtgwf+RX0jXaJObsi4Lv7AaQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeftddgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnth gvrhhprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeehleffgeegudejteei hfelteduvdeifffhffdvjedvffegjeekudeludehudeifeenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghu thesvghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Feedback-ID: i131946ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Mar 2023 06:26:47 -0400 (EDT) Message-ID: Date: Thu, 16 Mar 2023 11:26:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: Transparent column encryption Content-Language: en-US To: Andres Freund Cc: pgsql-hackers References: <1034b6f1-ccab-8a22-c843-71104ebedf01@enterprisedb.com> <40c43d0d-ae4b-fe34-2667-771b3718384e@enterprisedb.com> <47e17f03-6595-6c09-8978-7a1581cad6f2@enterprisedb.com> <7a430d89-233b-5cd7-6892-9fed06695d39@enterprisedb.com> <20230312001125.ijeu4imbwlhj5flf@awork3.anarazel.de> <43a88695-5e0b-4379-94cf-0392fdea4be9@enterprisedb.com> <20230313204119.4mkepdvixcxrwpsc@awork3.anarazel.de> <20230313211108.zge6vnqukexkih62@awork3.anarazel.de> From: Peter Eisentraut In-Reply-To: <20230313211108.zge6vnqukexkih62@awork3.anarazel.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 13.03.23 22:11, Andres Freund wrote: >> It adds branches, and it makes tupledescs wider. In tight spots, such as >> printtup, that can hurt, even if the branches aren't ever entered. > In fact, I do see a noticable, but not huge, regression: I tried to reproduce your measurements, but I don't have the CPU affinity tools like that on macOS, so the differences were lost in the noise. (The absolute numbers looked very similar to yours.) I can reproduce a regression if I keep adding more columns to pg_attribute, like 8 OID columns does start to show. I investigated whether I could move some columns to the "variable-length" part outside the tuple descriptor, but that would require major surgery in heap.c and tablecmds.c (MergeAttributes() ... shudder), and also elsewhere, where you currently only have a tuple descriptor for looking up stuff. How do we proceed here? A lot of user-facing table management stuff like compression, statistics, collation, dropped columns, and probably future features like column reordering or periods, have to be represented in pg_attribute somehow, at least in the current architecture. Do we hope that hardware keeps up with the pace at which we add new features? Do we need to decouple tuple descriptors from pg_attribute altogether? How do we decide what goes into the tuple descriptor and what does not? I'm interested in addressing this, because obviously we do want the ability to add more features in the future, but I don't know what the direction should be.