Re: tracking commit timestamps - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: tracking commit timestamps
Date
Msg-id 54AA3FFA.7040703@2ndquadrant.com
Whole thread Raw
In response to Re: tracking commit timestamps  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers
On 12/19/2014 02:53 PM, Noah Misch wrote:
> The test assumed that no two transactions of a given backend will get the same
> timestamp value from now().  That holds so long as ticks of the system time
> are small enough.  Not so on at least some Windows configurations.

Most Windows systems with nothing else running will have 15 ms timer
granularity. So multiple timestamps allocated within the same
millisecond will have the same value for timestamps captured within that
interval.

If you're running other programs that use the multimedia timer APIs
(including Google Chrome, MS SQL Server, and all sorts of other apps you
might not expect) you'll probably have 1ms timer granularity instead.

Since PostgreSQL 9.4 and below capture time on Windows using
GetSystemTime the sub-millisecond part is lost anyway. On 9.5 it's
retained but will usually be some fixed value because the timer tick is
still 1ms.

If you're on Windows 8 or Windows 2012 and running PostgreSQL 9.5
(master), but not earlier versions, you'll get sub-microsecond
resolution like on sensible platforms.

Some details here: https://github.com/2ndQuadrant/pg_sysdatetime

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Typo in function header for recently added function errhidecontext
Next
From: Michael Paquier
Date:
Subject: Re: Patch: add recovery_timeout option to control timeout of restore_command nonzero status code