pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: John A Meinel <john@arbash-meinel.com>
Cc: Magnus Hagander <mha@sollentuna.net>
Cc: Ken Egervari <ken@upfactor.com>
Cc: pgsql-performance@postgresql.org
Cc: pgsql-hackers-win32@postgresql.org
Subject: Re: [PERFORM] Help with tuning this query (with explain analyze finally)
Date: Mon, 07 Mar 2005 11:38:51 -0500
Message-ID: <2555.1110213531@sss.pgh.pa.us> (raw)
In-Reply-To: <422C817A.8050009@arbash-meinel.com>
References: <6BCB9D8A16AC4241919521715F4D8BCE476A60@algol.sollentuna.se>
	<23086.1110206737@sss.pgh.pa.us>
	<422C817A.8050009@arbash-meinel.com>

John A Meinel <john@arbash-meinel.com> writes:
>>> Can we just replace gettimeofday() with a version that's basically:
>> 
>> No, because it's also used for actual time-of-day calls.  It'd be
>> necessary to hack executor/instrument.c in particular.

> Or we modify the win32 gettimeofday call to something like:

That's what Magnus was talking about, but it's really no good because
it would cause Postgres' now() function to fail to track post-boot-time
changes in the system date setting.  Which I think would rightly be
considered a bug.

The EXPLAIN ANALYZE instrumentation code will really be happier with a
straight time-since-bootup counter; by using gettimeofday, it is
vulnerable to giving wrong answers if someone changes the date setting
while the EXPLAIN is running.  But there is (AFAIK) no such call among
the portable Unix syscalls.  It seems reasonable to me to #ifdef that
code to make use of QueryPerformanceCounter on Windows.  This does not
mean we want to alter the behavior of gettimeofday() where it's being
used to find out the time of day.

			regards, tom lane



view thread (26+ messages)  latest in thread

Message-ID: <2555.1110213531@sss.pgh.pa.us>
Permalink:  ../2555.1110213531@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2555.1110213531@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, john@arbash-meinel.com, mha@sollentuna.net, ken@upfactor.com, pgsql-hackers-win32@postgresql.org
  Subject: Re: [PERFORM] Help with tuning this query (with explain analyze finally)
  In-Reply-To: <2555.1110213531@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox