Skip site navigation (1) Skip section navigation (2)

Re: Patch: add timing of buffer I/O requests

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Geoghegan <peter(at)2ndquadrant(dot)com>, Ants Aasma <ants(at)cybertec(dot)at>, Greg Smith <greg(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch: add timing of buffer I/O requests
Date: 2012-04-25 18:08:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Greg Stark <stark(at)mit(dot)edu> writes:
> On Wed, Apr 25, 2012 at 5:47 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Also, as was pointed out upthread, the underlying data in shared memory
>> is almost certainly never going to be infinite-precision; so using
>> numeric in the API seems to me to be more likely to convey a false
>> impression of exactness than to do anything useful.

> I don't think that follows. The underlyng data will be measured in
> some metric unit of time like microsecond or nanosecond or something
> like that. So a base-10 representation will show exactly the precision
> that the underlying data has. On the other hand a floating point
> number will show a base-2 approximation that may in fact display with
> more digits than the underlying data representation has.

My point is that the underlying data is going to be stored in a
fixed-width representation, and therefore it will have accuracy and/or
range limitations that are considerably more severe than use of
"numeric" for output might suggest to the user.  In the current
pg_stat_statements code, timings are in fact accumulated in float8,
and emitting them as something other than float8 is just plain
misleading IMHO.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Michael GlaesemannDate: 2012-04-25 18:10:55
Subject: Re: proposal - urlencode, urldecode support
Previous:From: Greg StarkDate: 2012-04-25 17:58:36
Subject: Re: Patch: add timing of buffer I/O requests

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group