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 1tpCSA-001n1I-Gs for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Mar 2025 20:31:54 +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 1tpCS8-00FuNj-SG for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Mar 2025 20:31:52 +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.94.2) (envelope-from ) id 1tpCS8-00FuMq-EW for pgsql-hackers@lists.postgresql.org; Mon, 03 Mar 2025 20:31:52 +0000 Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tpCS5-000mY6-1n for pgsql-hackers@lists.postgresql.org; Mon, 03 Mar 2025 20:31:51 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 6CEE04444C; Mon, 3 Mar 2025 20:31:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vondra.me; s=gm1; t=1741033904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rzrO7vlqbEDD0pHUwf/0pqryGXNiBv2BBNjwByjrd+4=; b=oq6QDRBHzdzxbB3Y8GISl/BSyH/lLSw7Erl+mnzSUJIpQDgHJ/+WpKg+kcI//lMb+IruNN hxVzBjA9bCWAWQteBz9XCUsvT2+AIbX+ZYxraBejAkRZEjRekDLMMunS5JHA/8jkWZGTtJ k2kPzpHv3DYrp0jM9dFx1UWmTN5Bb6PWby83JZh3gyzl1tdOYtAlvATB2bdsS2Og/Ox51v QMG3V45jL/RqJBlnyT7W+PKEdd97CgGVwhxTvTRDPFcnC8QOtFkgIusQbxrn4Vi1IGbc+S RE+vE9P2Il5Ne4WMzWqAk3emufRPzbKQitrWydb4TRM7HSQ9XozPv2/UDOq1Ng== Message-ID: Date: Mon, 3 Mar 2025 21:31:42 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: scalability bottlenecks with (many) partitions (and more) To: Andres Freund Cc: Jakub Wartak , Robert Haas , PostgreSQL Hackers References: <52f026c4-6c4e-4de2-bd78-609091d7c772@vondra.me> <14cd8763-c905-4705-99c5-cbcc5db06f50@vondra.me> <0775ba8a-920c-4d37-b202-989a90b6ee4c@vondra.me> <0f27b64b-5bf3-4140-98b7-635e312e1796@vondra.me> <3cebb4ab-1168-4259-8cb8-8a8ed7efeb43@vondra.me> <7c1eeafb-2375-4ff6-8469-0640d52d44ed@vondra.me> Content-Language: en-US From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddutddttdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepvfhomhgrshcugghonhgurhgruceothhomhgrshesvhhonhgurhgrrdhmvgeqnecuggftrfgrthhtvghrnhepledugeeikefglefhgfffuedvleetteevgefhvdeikeefudduuddvhfevudefhfevnecukfhppeekiedrgeelrddvfedurdduheegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepkeeirdegledrvdefuddrudehgedphhgvlhhopegluddtrddufeejrddtrddukegnpdhmrghilhhfrhhomhepthhomhgrshesvhhonhgurhgrrdhmvgdpnhgspghrtghpthhtohepgedprhgtphhtthhopegrnhgurhgvshesrghnrghrrgiivghlrdguvgdprhgtphhtthhopehjrghkuhgsrdifrghrthgrkhesvghnthgvrhhprhhishgvuggsrdgtohhmpdhrtghpthhtoheprhhosggvrhhtmhhhrggrshesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-GND-Sasl: tomas@vondra.me List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/3/25 19:10, Andres Freund wrote: > Hi, > > On 2024-09-21 20:33:49 +0200, Tomas Vondra wrote: >> I've finally pushed this, after many rounds of careful testing to ensure >> no regressions, and polishing. > > One minor nit: I don't like that FP_LOCK_SLOTS_PER_BACKEND is now non-constant > while looking like a constant: > > #define FP_LOCK_SLOTS_PER_BACKEND (FP_LOCK_SLOTS_PER_GROUP * FastPathLockGroupsPerBackend) > > I don't think it's a good idea to have non-function-like #defines that > reference variables that can change from run to run. > Fair point, although it can't change "run to run" - not without a restart. It's not a proper constant, of course, but it seemed close enough. Yes, it might confuse people into thinking it's a constant, or is there some additional impact? The one fix I can think of is making it look more like a function, possibly just like this: #define FastPathLockSlotsPerBackend() \ (FP_LOCK_SLOTS_PER_GROUP * FastPathLockGroupsPerBackend) Or do you have another suggestion? regards -- Tomas Vondra