Re: [HACKERS] max backends checking patch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] max backends checking patch
Date
Msg-id 9309.915988074@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] max backends checking patch  (Tatsuo Ishii <t-ishii@sra.co.jp>)
List pgsql-hackers
Tatsuo Ishii <t-ishii@sra.co.jp> writes:
>> Couldn't postmaster just keep # of backends running
>> in some variable, instead of examining BackendList ?

> Yes, you could do that way. I just want to keep things simple.
> Seems a seed of "maintenance problem" in the future IMHO:-)

I agree with Tatsuo.  Counting the children once per backend startup
is certainly not a performance bottleneck, so there is no reason to
add complexity and a source of potential bugs to speed it up.

> Having a counter inside the dllist module is another idea. If there
> were many codes in the backend that counting elemnts in the dllist,
> this would be worth to think about.

That would be reasonable if justified by usage --- the tradeoff is
the added cost of maintaining the count for every dllist, whether or
not it's ever asked for...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Vadim Mikheev
Date:
Subject: Re: [HACKERS] MVCC works in serialized mode!
Next
From: Vadim Mikheev
Date:
Subject: Re: [HACKERS] MVCC works in serialized mode!