Skip site navigation (1) Skip section navigation (2)

Re: [PERFORM] Help with tuning this query (with

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>,"Steinar H(dot) Gunderson" <sgunderson(at)bigfoot(dot)com>
Cc: "Dave Held" <dave(dot)held(at)arrayservicesgrp(dot)com>,"Greg Stark" <gsstark(at)mit(dot)edu>,"John A Meinel" <john(at)arbash-meinel(dot)com>,"Ken Egervari" <ken(at)upfactor(dot)com>,<pgsql-performance(at)postgresql(dot)org>,<pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: [PERFORM] Help with tuning this query (with
Date: 2005-03-08 09:05:08
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE476A65@algol.sollentuna.se (view raw or flat)
Thread:
Lists: pgsql-hackers-win32pgsql-performance
> > RDTSC is a bad source of information for this kind of thing, as the 
> > CPU frequency might vary.
> 
> One thought that was bothering me was that if the CPU goes 
> idle while waiting for disk I/O, its clock might stop or slow 
> down dramatically.
> If we believed such a counter for EXPLAIN, we'd severely 
> understate the cost of disk I/O.
> 
> I dunno if that is the case on any Windows hardware or not, 
> but none of this thread is making me feel confident that we 
> know what QueryPerformanceCounter does measure.

I'm "reasonaly confident" that QPC will measure actual wallclock time as
passed, using a chip that is external to the CPU. (Don't ask me which
chip :P).

The docs specifically say: "Note that the frequency of the
high-resolution performance counter is not the processor speed." 

It also indicates that it is possible for hardware not to support it, in
which case the frequency will be reported as zero. I don't know any
remotely modern wintel system that doesn't, though - it seems this may
be referring to the old MIPS port of NT that didn't have it.

I also find:
"Depending on the processor and exact version of NT you're using, on an
Intel you get either the Time Stamp Counter, or the 1.1... MHz timer
built into the motherboard."


So I think we're perfectly safe relying on it. And certainly not alone
in doing so :-)

//Magnus

pgsql-performance by date

Next:From: Gaetano MendolaDate: 2005-03-08 10:32:03
Subject: bad plan
Previous:From: tsarevichDate: 2005-03-08 07:47:37
Subject: Re: Tuning, configuration for 7.3.5 on a Sun E4500

pgsql-hackers-win32 by date

Next:From: Rodrigo MorenoDate: 2005-03-08 20:37:30
Subject: Connection is closed in pg801 using pgadmin3
Previous:From: John A MeinelDate: 2005-03-08 04:35:09
Subject: Re: [PERFORM] Help with tuning this query (with

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group