public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tomas Vondra <[email protected]>
To: Andres Freund <[email protected]>
Cc: Jakub Wartak <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: scalability bottlenecks with (many) partitions (and more)
Date: Mon, 3 Mar 2025 21:31:42 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <ffiwtzc6vedo6wb4gbwelon5nefqg675t5c7an2ta7pcz646cg@qwmkdb3l4ett>
References: <CA+TgmobCBse3LYj9pfh-ELbP0VnffQS7jP_vNTGA7-KZP0gqDw@mail.gmail.com>
	<[email protected]>
	<CA+TgmoamAOj5e4J7WcC9g10AskvVPk5D7JoAvWw8DFnpHMiSQA@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAKZiRmze8L6FeAKNQhZkn4NmUH2WZZyQ46GUm-Xuky5qr5DUoA@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<ffiwtzc6vedo6wb4gbwelon5nefqg675t5c7an2ta7pcz646cg@qwmkdb3l4ett>



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







view thread (34+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: scalability bottlenecks with (many) partitions (and more)
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox