X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5246B55CC5 for ; Wed, 2 Mar 2005 23:25:27 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 32885-02 for ; Wed, 2 Mar 2005 23:25:25 +0000 (GMT) Received: from ct.radiology.uiowa.edu (ct.radiology.uiowa.edu [129.255.60.186]) by svr1.postgresql.org (Postfix) with ESMTP id CF57A558AC for ; Wed, 2 Mar 2005 23:25:23 +0000 (GMT) Received: from [192.168.1.11] (12-217-241-0.client.mchsi.com [12.217.241.0]) by ct.radiology.uiowa.edu (8.11.6/8.11.6) with ESMTP id j22NPK324500; Wed, 2 Mar 2005 17:25:21 -0600 Message-ID: <42264B56.40007@arbash-meinel.com> Date: Wed, 02 Mar 2005 17:25:10 -0600 From: John A Meinel User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Ken Egervari , =?ISO-8859-1?Q?Ragnar_Hafsta=F0?= , pgsql-performance@postgresql.org Subject: Re: Help with tuning this query (with explain analyze finally) 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> In-Reply-To: <13490.1109795370@sss.pgh.pa.us> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigDBE8276913703A68AA30A857" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200503/41 X-Sequence-Number: 10746 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDBE8276913703A68AA30A857 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Tom Lane wrote: >"Ken Egervari" 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 #include 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 =:-> --------------enigDBE8276913703A68AA30A857 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (Cygwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCJktbJdeBCYSNAAMRAoPBAKCwi3p3OwtwEvPaAGVUWrVROinv2QCg2Ckl UOgj85Hf380DCBUv67nOu7Y= =3TLj -----END PGP SIGNATURE----- --------------enigDBE8276913703A68AA30A857--