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 50A695659A for ; Mon, 7 Mar 2005 16:39:07 +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 23017-08 for ; Mon, 7 Mar 2005 16:38:59 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 61E5F563D0 for ; Mon, 7 Mar 2005 16:38:59 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j27GcqGw002556; Mon, 7 Mar 2005 11:38:52 -0500 (EST) To: John A Meinel Cc: Magnus Hagander , Ken Egervari , pgsql-performance@postgresql.org, pgsql-hackers-win32@postgresql.org Subject: Re: [PERFORM] Help with tuning this query (with explain analyze finally) In-reply-to: <422C817A.8050009@arbash-meinel.com> References: <6BCB9D8A16AC4241919521715F4D8BCE476A60@algol.sollentuna.se> <23086.1110206737@sss.pgh.pa.us> <422C817A.8050009@arbash-meinel.com> Comments: In-reply-to John A Meinel message dated "Mon, 07 Mar 2005 10:29:46 -0600" Date: Mon, 07 Mar 2005 11:38:51 -0500 Message-ID: <2555.1110213531@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/54 X-Sequence-Number: 3012 John A Meinel 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