Re: Help with tuning this query (with explain analyze finally)

From: John A Meinel <john(at)arbash-meinel(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ken Egervari <ken(at)upfactor(dot)com>, Ragnar Hafstað <gnari(at)simnet(dot)is>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Help with tuning this query (with explain analyze finally)
Date: 2005-03-02 23:25:10
Message-ID: 42264B56.40007@arbash-meinel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32 pgsql-performance

Tom Lane wrote:

>"Ken Egervari" <ken(at)upfactor(dot)com> writes:
>
>
>>Okay, here is the explain analyze I managed to get from work.
>>
>>
>
>What platform is this on? It seems very strange/fishy that all the
>actual-time values are exact integral milliseconds.
>
>
>
I always get round milliseconds on running. In fact, I think I've seen
cases where it was actually rounding to 15/16ms. Which is the resolution
of the "clock()" call (IIRC).

This is the function I have for returning time better than clock(), but
it looks like it is still stuck no better than 1ms.
/*
* MSVC has a function called _ftime64, which is in
* "sys/timeb.h", which should be accurate to milliseconds
*/

#include <sys/types.h>
#include <sys/timeb.h>

double mf::getTime()
{
struct __timeb64 timeNow;
_ftime64(&timeNow);
return timeNow.time + timeNow.millitm / 1000.0;
}

I did, however, find this page:
http://www.wideman-one.com/gw/tech/dataacq/wintiming.htm

Which talks about the high performance counter, which is supposed to be
able to get better than 1us resolution.

GetSystemTimes() returns the idle/kernel/user times, and seems to have a
resolution of about 100ns (.1us) GetLocalTime()/GetSystemTime() only has
a resolution of milliseconds.

In my simple test, I was actually getting timings with a resolution of
.3us for the QueryPerformanceCounter(). That was the overhead of just
the call, since it was called either in a bare loop, or just one after
the other.

So probably we just need to switch to QueryPerformanceCounter()
[/Frequency].

John
=:->

In response to

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Bruce Momjian 2005-03-03 00:03:02 Re: [pgsql-hackers-win32] snprintf causes regression tests
Previous Message Dave Held 2005-03-02 23:01:14 Re: [PERFORM] Help with tuning this query (with explain analyze finally)

Browse pgsql-performance by date

  From Date Subject
Next Message Ken Egervari 2005-03-03 01:20:33 Re: Help with tuning this query (with explain analyze finally)
Previous Message Dave Held 2005-03-02 23:01:14 Re: [PERFORM] Help with tuning this query (with explain analyze finally)