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
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq