From: Tom Lane <tgl@sss.pgh.pa.us>
To: 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: Wed, 02 Mar 2005 17:29:48 -0500
Message-ID: <14444.1109802588@sss.pgh.pa.us> (raw)
In-Reply-To: <000801c51f67$c3abdcc0$6a01a8c0@KEN>
References: <001001c51ef4$3849eeb0$6a01a8c0@KEN>
<1109787227.31084.12.camel@localhost.localdomain>
<000901c51f55$aa4b7400$6a01a8c0@KEN>
<1109789394.31084.20.camel@localhost.localdomain>
<000601c51f63$63c8bb10$6a01a8c0@KEN>
<13490.1109795370@sss.pgh.pa.us>
<000801c51f67$c3abdcc0$6a01a8c0@KEN>
"Ken Egervari" <ken@upfactor.com> writes:
>> What platform is this on? It seems very strange/fishy that all the
>> actual-time values are exact integral milliseconds.
> My machine is WinXP professional, athon xp 2100, but I get similar results
> on my Intel P4 3.0Ghz as well (which is also running WinXP). Why do you
> ask?
Well, what it suggests is that gettimeofday() is only returning a result
good to the nearest millisecond. (Win32 hackers, does that sound right?)
If so, I'd have to take the EXPLAIN ANALYZE results with a big grain of
salt, because what it's trying to do is add up a lot of
mostly-sub-millisecond intervals. What would essentially happen is that
whichever plan node had control at a particular millisecond boundary
would get charged for the whole preceding millisecond, and any other
nodes (which might have actually eaten most of the millisecond) would
get charged nothing.
Over a sufficiently long query run, the errors would average out, but
this wasn't that long --- 312 milliseconds, so in essence we are trying
to estimate the query's behavior from only 312 samples of where it was
at the millisecond boundaries. I don't trust profiles based on less
than a few thousand samples ...
Most modern machines seem to have clocks that can count elapsed time
down to near the microsecond level. Anyone know if it's possible to get
such numbers out of Windows, or are we stuck with milliseconds?
regards, tom lane
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, ken@upfactor.com, pgsql-hackers-win32@postgresql.org
Subject: Re: [PERFORM] Help with tuning this query (with explain analyze finally)
In-Reply-To: <14444.1109802588@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