Re: GUC with units, details

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: GUC with units, details
Дата
Msg-id 200607280103.00652.peter_e@gmx.net
обсуждение исходный текст
Ответ на Re: GUC with units, details  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: GUC with units, details  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: GUC with units, details  ("Jim C. Nasby" <jnasby@pervasive.com>)
Список pgsql-hackers
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

not
  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 * 
unit.)

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Gregory Stark
Дата:
Сообщение: [tgl@postgresql.org (Tom Lane)] [COMMITTERS] pgsql: Aggregate functions now support multiple input arguments.
Следующее
От: Tom Lane
Дата:
Сообщение: Do we need multiple forms of the SQL2003 statistics aggregates?