Re: Explain buffers display units.

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: "<pgsql-hackers(at)postgresql(dot)org>" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Explain buffers display units.
Date: 2010-02-15 18:05:30
Message-ID: 603c8f071002151005y2d6f8d41qc6f6644bfd9e5040@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 15, 2010 at 9:55 AM, Greg Stark <stark(at)mit(dot)edu> wrote:
> On Mon, Feb 15, 2010 at 2:22 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>> a) Changed the line description to "Total Buffer Usage" which at least
>>> hints that it's something more akin to the "Total runtime" listed at
>>> the bottom than the "actual time".
>>>
>>> b) Used units of memory -- I formatted them with 3 significant digits
>>> (unless the unit is bytes or kB where that would be silly). It's just
>>> what looked best to my eye.
>>
>> I wasn't aware we had consensus on making this change, which I see you
>> committed less than an hour after posting this.
>
> Well there was a 30+ message thread almost a week ago where there
> seemed to be some contention over the issue of whether the numbers
> should be averages or totals. But were there was no dispute over the
> idea of printing in memory units instead of blocks.

Hmm.... yeah, I guess it wasn't discussed. I'm still not sure it's an
improvement. If a query hit one buffer, is that really the same as
saying it hit 8kB? To me, buffers seem like discrete (and unitless)
entities, and we handle them that way elsewhere in the system (see,
e.g. pg_stat_database, pg_statio_all_tables). I don't know that it's
a good idea to display that same information here in a different
format.

> We can always continue tweak the details of the format such as adding
> spaces before the units to make it similar to the pg_size_pretty().
> I'm not sure I like the idea of making it exactly equivalent because
> pg_size_pretty() doesn't print any decimals so it's pretty imprecise
> for smaller values.

I definitely do not want to do anything that loses accuracy. This is
probably accurate enough for most uses, but it's still not as accurate
as just printing the raw numbers.

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gabriele Bartolini 2010-02-15 18:20:00 Re: psycopg2 license changed
Previous Message Greg Smith 2010-02-15 17:55:20 Re: Explain buffers display units.