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.96) (envelope-from ) id 1vfcjV-003USL-29 for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Jan 2026 11:38:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vfcjU-004Whd-2w for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Jan 2026 11:38:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vfcjU-004WhV-0j for pgsql-hackers@lists.postgresql.org; Tue, 13 Jan 2026 11:38:44 +0000 Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vfcjR-000C0Q-1v for pgsql-hackers@postgresql.org; Tue, 13 Jan 2026 11:38:43 +0000 Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfhigh.phl.internal (Postfix) with ESMTP id B38A5140010C; Tue, 13 Jan 2026 06:38:40 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Tue, 13 Jan 2026 06:38:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm1; t=1768304320; x= 1768390720; bh=mgkVw/ZDCGWQHwbEC1xnCutfJ+GzbuJ5cC9itYcbSHo=; b=k ofk2FX1GJI/YQmp5e9ntSNe4CS2HpXUXwfunwpieIl2eP2Yb9epmCAjmUfzj0Oul h8b2vO48EQn9kZYLLqFcTmJ0up07f7rmWyRO1sserAMgy2HdNwS99s6IdMGrEFCT XRrbyh3BTyXVFSAMTqAsreRWivPIPoVG8wUI/uvsCgRKFvFZm8Iy8YFJwjwUYFTm U3ThenddQ9bHb1gFmS2Ozil8wPW2ZUW2yR6xBeVPJx36UfULjc2gL+pWXlf2iqkj AtxZ4u9fBlukVyyYHfb9w1p3XsLTYRGS7Vmu/sOU0moGMyU3v7GUK1J5S0DcG96P c5PGYvavyK2Or1K7NIluQ== 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 :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1768304320; x=1768390720; bh=m gkVw/ZDCGWQHwbEC1xnCutfJ+GzbuJ5cC9itYcbSHo=; b=CVX1fh6ObQfP4QiyV y8D07i84E0pPxzgeZ9ZHNI+Jf9t5UWxLJO9K/M/fMQw+U+OTuph6WNn9pYy7zQMc +w8GCSAe21C+7XtqFOLMm3Q+O02j56P0cwv6K1VXWzXN4/zH92TarPWKYFAE1HXH HwYBMoknWuZHWtrqbEcNZSw23nty0d1+de2HIm7h3gb0BMgWFQFBK3SVOPfVmqv2 kdmFohF+6MZmDZ2vMUtKYyULSCWHBp43XttaaTAjpWSlcnHbt9JJDr6vh9T2AyQP /M3uKWCpb1UdEh9LpQDFGlGGwH3WgYJ/r7pradDFxo7C1D2RzJoy48Ss490SnjHH ErjCA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduvddtvddvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeetuedvheffkeevgfeuheevteevkefggedttdeufeeuheduuddthfef fffhjeefffenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgv sehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopeeipdhmohguvgepshhmthhpoh huthdprhgtphhtthhopegughhrohiflhgvhihmlhesghhmrghilhdrtghomhdprhgtphht thhopehgohhniigrlhgvmhgrrhhiohesghhmrghilhdrtghomhdprhgtphhtthhopehjrg gtohgsrdgsrhgriigvrghlsehgmhgrihhlrdgtohhmpdhrtghpthhtohepjhhohhhntghn rgihlhhorhhlshesghhmrghilhdrtghomhdprhgtphhtthhopehlihdrvghvrghnrdgthh grohesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehp ohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Jan 2026 06:38:40 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1768304319; bh=lW1Jf0l8vpbGDimVPFlIBd9cVmHRPH7V5lQj+KpXfAc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=1/RIoE2brt2Wrz9DXNMGdvCrMYqP9EgtSTR7D5Ws9IiwnuhUnyY4tTLIi+RffTP8G egwysjrAsTmvsfUM8F2qnQCJFkadGG+oZHbaCrXy8/Uz6afsWU3ExKAn3izssSNGNw 2D5xJxj8aDk5Q2q7FRHY1IA/SLKjW9W0+563QapTDCsy1G3TCGLHwSv5/SLERd6qfb zIxlHPon5n59eys4iH1Zujhlf+ZQUuFwNyTe9VoTyMW/T7phH8BW2f03O4U/6LT2he O9JUtDY+ccM+BuLxumAH7kq2ZTgMymMBQFKlHgXPDWrXvgXLmQXklJiMdVjBIzcsCj fHhCkJKw4PYSw== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 139CE7A; Tue, 13 Jan 2026 12:38:39 +0100 (CET) Date: Tue, 13 Jan 2026 12:38:39 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: David Rowley Cc: Mario =?utf-8?B?R29uesOhbGV6?= Troncoso , Chao Li , pgsql-hackers , Jacob Brazeal , John Naylor Subject: Re: [PATCH} Move instrumentation structs Message-ID: <202601131123.vxjoh2uwgavb@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-Jan-13, David Rowley wrote: > There's a bit of conflicting opinion going on here with the changes > made in 128897b101e0. > > "false when it's value for in-memory space" > > I think the differing opinions depend on what you fill in the missing > words with in the badly written English. If you read "value" as "the > value", then "it's" is correct. Whereas if you read it as "value is", > then "its" is correct. I assume you didn't read it the same way as > John did. Yeah, if the "is" had been there I wouldn't have made the change. I mean, this would have been correct: true when maxSpace is value for on-disk space, false when its value is for in-memory space I debated whether to add the "is" or change the "its" to "it's" and decided that the smaller change was better. But I agree that a bigger rewording may be a better solution. > + bool isMaxSpaceDisk; /* true when the maxSpace value tracking is > + * on-disk space, false means it's tracking > + * memory space */ Sounds about right, though I think we can shave some words off that. How about int64 maxSpace; /* maximum amount of space occupied among sort * of groups, either in-memory or on-disk */ bool isMaxSpaceDisk; /* true when maxSpace tracks on-disk space, false * means in-memory */ ? (CCed Jacob as author and John as committer of that change, in case they care to comment.) FWIW the original wording comes from d2d8a229bc58. Incidentally, I notice that tuplesort_updatemax() has this comment: /* * Note: it might seem we should provide both memory and disk usage for a * disk-based sort. However, the current code doesn't track memory space * accurately once we have begun to return tuples to the caller (since we * don't account for pfree's the caller is expected to do), so we cannot * rely on availMem in a disk sort. This does not seem worth the overhead * to fix. Is it worth creating an API for the memory context code to * tell us how much is actually used in sortcontext? */ ... and I think we already have the API that this comment hypothesizes about. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "La virtud es el justo medio entre dos defectos" (Aristóteles)