Robert Haas <robertmhaas@gmail.com> writes:
> ... 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.
EXPLAIN ANALYZE *necessarily* does less work than the real query,
because it doesn't transmit the results to the client (which is going
to be a dominant cost in a lot of situations). I'm not sure whether
running the I/O functions would provide a useful improvement in
verisimilitude or not; but one should never imagine that EXPLAIN is an
exact simulation of normal query execution. It's meant for debugging
planner choices, anyway, and the detoast&I/O costs are going to be the
same whichever plan you choose.
regards, tom lane