Re: Does EXPLAIN ANALYZE show a wrong plan for MIN/MAX? - Mailing list pgsql-hackers

From Matteo Beccati
Subject Re: Does EXPLAIN ANALYZE show a wrong plan for MIN/MAX?
Date
Msg-id 437484FF.1080809@beccati.com
Whole thread Raw
In response to Re: Does EXPLAIN ANALYZE show a wrong plan for MIN/MAX?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Martijn van Oosterhout wrote:
>> I've noticed that sometimes EXPLAIN ANALYZE is much slower than the 
>> plain query. After investigating I found that it happens when using MIN 
>> or MAX aggregates.
>>
>> It seems that the plan outputted is not the optimized one (available 
>> since 8.1) that is really used when running the plain query.
> 
> It may also be that the overhead of calling gettimeofday() several
> times per tuple is blowing the time out. What platform is this?

FreeBSD 5.4-RELEASE on an HP DL380 G4.

I've also tried to do the same on another machine which has 8.0.3 and 
FreeBSD 4.9-RELEASE-p3: times for the same query are 15s vs 63s with 
EXPLAIN ANALYZE. Of course I know 8.0 doesn't optimize min/max the same 
way 8.1 does.

Hope this helps.


Best regards
--
Matteo Beccati
http://phpadsnew.com
http://phppgads.com


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Does EXPLAIN ANALYZE show a wrong plan for MIN/MAX?
Next
From: Peter Eisentraut
Date:
Subject: Re: lc_numeric and decimal delimiter