Re: BUG #6513: explain (analyze, buffers) and toasted fields

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: maxim(dot)boguk(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6513: explain (analyze, buffers) and toasted fields
Date: 2012-03-12 15:07:55
Message-ID: CA+TgmoaGQOrC+y=T4_12Pt3G1CyuHJLuo1SXmqDgFoxSv0XJ0A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, Mar 4, 2012 at 11:22 PM, <maxim(dot)boguk(at)gmail(dot)com> wrote:
> I got hit by that bug when explored reasons of one very slow production
> query again.
> And I lost a lot time trying reproduce the problem query on production
> server with explain analyze.
> Finally I found I need some workaround to get explain perform actual work
> with toasted data.
>
> So there is going the bug report:
> EXPLAIN do not take into account that some result fields will require
> detoasting and produce wrong buffers result.

Well, the buffers result is, I think, not wrong. That's just a count
of how many buffers were actually read or written or whatever, and it
is what it is. I think that if there's an actual bug here, it's that
EXPLAIN ANALYZE is skipping the formation of the actual output tuples,
and therefore it's doing less work than an actual execution of the
real query would. I am not sure whether it would be a good idea to
change that or not.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2012-03-12 15:16:18 Re: BUG #6517: Volatile function erroneously optimized, does not consider change in schema path
Previous Message Robert Haas 2012-03-12 15:04:21 Re: BUG #6517: Volatile function erroneously optimized, does not consider change in schema path