Re: Does EXPLAIN ANALYZE show a wrong plan for MIN/MAX?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Matteo Beccati <php(at)beccati(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Does EXPLAIN ANALYZE show a wrong plan for MIN/MAX?
Date: 2005-11-11 11:21:28
Message-ID: 20051111112128.GD13177@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 11, 2005 at 11:05:45AM +0100, Matteo Beccati wrote:
> Hi,
>
> 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?

Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matteo Beccati 2005-11-11 11:48:15 Re: Does EXPLAIN ANALYZE show a wrong plan for MIN/MAX?
Previous Message pmagnoli 2005-11-11 11:12:12 Postgresql 8.1 XML2