Re: A costing analysis tool

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, josh(at)agliodbs(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: A costing analysis tool
Date: 2005-10-15 22:48:25
Message-ID: 3238.1129416505@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> Interestingly, I notice the windows port of PostgreSQL uses the
> QueryPerformanceCounter() function. I tried playing with it under linux
> and found that Linux suspends the CPU while waiting for things to
> happen. So:

> sleep(1) ~ 20 million cycles
> busy loop for 1 second ~ 800 million cycles (CPU speed)

> So, what's good for battery and power usage is bad for accurate
> timings. Basically, on Linux it would seriously underestimate the time
> for blocking system calls on an otherwise idle system. So, it works for
> Windows because they don't do this...

Hmm ... are we *sure* they don't do that? The QueryPerformanceCounter
implementation was added just recently, and I'm not sure it's been
tested under any wide range of scenarios. Maybe we will find that it
doesn't work :-(

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2005-10-16 00:13:32 Re: [HACKERS] roundoff problem in time datatype
Previous Message Tom Lane 2005-10-15 22:45:22 Re: slow IN() clause for many cases