X-Original-To: pgsql-hackers-win32-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C1562564E3; Tue, 8 Mar 2005 04:35:25 +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 34029-02; Tue, 8 Mar 2005 04:35:16 +0000 (GMT) Received: from ct.radiology.uiowa.edu (ct.radiology.uiowa.edu [129.255.60.186]) by svr1.postgresql.org (Postfix) with ESMTP id 74C0D53DCA; Tue, 8 Mar 2005 04:35:14 +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 j284ZB316350; Mon, 7 Mar 2005 22:35:11 -0600 Message-ID: <422D2B7D.5080702@arbash-meinel.com> Date: Mon, 07 Mar 2005 22:35:09 -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: Dave Held , pgsql-performance@postgresql.org, pgsql-hackers-win32@postgresql.org Subject: Re: [PERFORM] Help with tuning this query (with References: <49E94D0CFCD4DB43AFBA928DDD20C8F90261846B@asg002.asg.local> <422CDA2A.1000105@arbash-meinel.com> <15994.1110236199@sss.pgh.pa.us> In-Reply-To: <15994.1110236199@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="------------enigC693134A2FD033AA11630BAA" 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/71 X-Sequence-Number: 3029 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC693134A2FD033AA11630BAA Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Tom Lane wrote: >John A Meinel writes: > > >>Dave Held wrote: >> >> >>>There is always clock(). >>> >>> > > > >>My experience with clock() on win32 is that CLOCKS_PER_SEC was 1000, and >>it had a resolution of 55clocks / s. When I just did this: >> >> > >The other problem is it measures process CPU time, not elapsed time >which is probably more significant for our purposes. > >Which brings up a question: just what does QueryPerformanceCounter >measure? > > regards, tom lane > > clock() according to the Visual Studio Help measures wall clock time. But you're right, POSIX says it is approximation of processor time. The docs don't say specifically what QueryPerformanceCounter() measures, but states > The *QueryPerformanceCounter* function retrieves the current value of > the high-resolution performance counter. > It also states: > > Remarks > > On a multiprocessor machine, it should not matter which processor is > called. However, you can get different results on different processors > due to bugs in the BIOS or the HAL. To specify processor affinity for > a thread, use the *SetThreadAffinityMask* function. > So it sounds like it is actually querying some counter independent of processing. In fact, there is also this statement: > *QueryPerformanceFrequency* > > The QueryPerformanceFrequency function retrieves the frequency of the > high-resolution performance counter, if one exists. The frequency > cannot change while the system is running. > If that is accurate, it would make QueryPerformanceCounter independent of things like speed stepping, etc. So again, it sounds independent of processing. John =:-> --------------enigC693134A2FD033AA11630BAA 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 iD8DBQFCLSt9JdeBCYSNAAMRAkCJAKCwuSLVFX1TWf0fWGwJmTleLjR2igCgkFPC SNF8uLWStHMD6OZC4RcWygk= =2sNH -----END PGP SIGNATURE----- --------------enigC693134A2FD033AA11630BAA--