Tom Lane wrote:
> +1 on both of those.  I think that pg_settings should actually show
> "pages" as the native unit for shared_buffers et al.  The current
> "8kb" display isn't a valid unit --- consider what happens if a
> program does select setting || unit from pg_settings ...

Physicists know that the proper way to do that calculation is

   setting * unit


   setting || unit

I was toying for a moment with putting '1' into the column when the 
quantity is dimensionless.  That would have been a fun debate.

I realize that it's not all that consistent or easy to process now.  
Accepting "page" (or "block"?) as a unit might be a reasonable 
addition.  Then again, I'm not sure why anyone would want to do 
setting || unit in the first place, because setting by itself will give 
you the right quantity to feed back into the system.

> Lastly, shouldn't unit read out as null where it's not applicable?
> It looks like it's null in some of the rows but empty string
> elsewhere. That's just weird.

It's null when units do not apply (for booleans, strings for conceptual 
reasons, for reals for implementation reasons), and it's empty when the 
unit is known to be nothing.  I don't contest that that's weird but I 
think it's the proper way to express the information (short of putting 
in '1' again).

(I'm thinking something like a units type that is occasionally discussed 
would be a good addition, so you can do calculations like setting * 

Peter Eisentraut

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?


Reply via email to