Re: [HACKERS] calculating an aspect of shared buffer state from a background worker

2014-03-10 Thread Robert Berry
Thank you both for the thoughtful and helpful responses. The utility of the length of the free list is somewhat dubious. I imagine it could be useful to answer the question of "is there a chance that increasing shared buffers would be useless?" in an optimization context. Agreed it's not useful

Re: [HACKERS] calculating an aspect of shared buffer state from a background worker

2014-03-10 Thread Tom Lane
Robert Berry writes: > I'm looking at doing a calculation to determine the number of free buffers > available. A n example ratio that is based on some data structures in > freelist.c as follows: > (StrategyControl->lastFreeBuffer - StrategyControl->firstFreeBuffer) / > (double) NBuffers > Is th

Re: [HACKERS] calculating an aspect of shared buffer state from a background worker

2014-03-09 Thread Michael Paquier
On Mon, Mar 10, 2014 at 2:09 PM, Robert Berry wrote: > Is there a way to get access to the StrategyControl pointer in the context > of a background worker? StrategyControl is inherent to freelist.c and has no external declaration so you could not have it even if you the BGWORKER_SHMEM_ACCESS flag.

[HACKERS] calculating an aspect of shared buffer state from a background worker

2014-03-09 Thread Robert Berry
Dear Hackers -- I'm looking at doing a calculation to determine the number of free buffers available. A n example ratio that is based on some data structures in freelist.c as follows: (StrategyControl->lastFreeBuffer - StrategyControl->firstFreeBuffer) / (double) NBuffers Is there a way to get