Re: A costing analysis tool - Mailing list pgsql-hackers

From Tom Lane
Subject Re: A costing analysis tool
Date
Msg-id 3238.1129416505@sss.pgh.pa.us
Whole thread Raw
In response to Re: A costing analysis tool  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: A costing analysis tool
List pgsql-hackers
Martijn van Oosterhout <kleptog@svana.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: slow IN() clause for many cases
Next
From: karen hill
Date:
Subject: PostgreSQL roadmap for 8.2 and beyond.