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

Re: review: pgbench - aggregation of info written into log

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tomas Vondra <tv(at)fuzzy(dot)cz>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Dave Page <dpage(at)pgadmin(dot)org>, Tatsuo Ishii <ishii(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: review: pgbench - aggregation of info written into log
Date: 2013-01-17 12:59:02
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On 01/17/2013 06:11 AM, Tomas Vondra wrote:
> Dne 17.01.2013 11:16, Magnus Hagander napsal:
>> On Thu, Jan 17, 2013 at 11:09 AM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
>>> On Thu, Jan 17, 2013 at 9:36 AM, Magnus Hagander 
>>> <magnus(at)hagander(dot)net> wrote:
>>>> We have committed platform-specific features before, but generally
>>>> only when it's not *possible* to do them for all platforms. For
>>>> example the posix_fadvise stuff isn't available on Windows at all, so
>>>> there isn't much we can do there.
>>> Right - having platform specific features for other reasons like lack
>>> of time is a slippery slope in my opinion. We should not get into such
>>> a habit or Windows will quickly become a second class platform as far
>>> as PostgreSQL features are concerned.
>> Especially since there is no lack of time - the functionality is
>> there, it just looks (significantly) different.
> Really? Any link to relevant docs or something?
> When doing some research in this field, the only option I was able to 
> come up
> with was combining gettimeofday() with the timing functionality, and 
> do something
> like this:
>   1) call gettimeofday() at thread start, giving a common unix timestamp
>   2) measure the time from the thread start using the conters (for 
> each transaction)
>   3) combine those values
> This might of course give up to a second difference compared to the 
> actual time
> (because of the gettimeofday precision), but IMHO that's fine.

The link I posted showed a technique which essentially uses edge 
detection on gettimeofday() to get an accurate correspondence between 
the time of day and the performance counter, following which you can 
supposedly calculate the time of day with a high degree of accuracy just 
from the performance counter. You should be able to do this just once, 
at program start. If you don't care that much about the initial 
precision then your procedure should work fine, I think.



In response to

pgsql-hackers by date

Next:From: Andres FreundDate: 2013-01-17 13:05:15
Subject: Re: Slave enters in recovery and promotes when WAL stream with master is cut + delay master/slave
Previous:From: Robert HaasDate: 2013-01-17 12:54:55
Subject: Re: Materialized views WIP patch

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