Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 006AA29F0D3 for ; Mon, 12 Mar 2012 12:23:59 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S776M-0003WX-KC for pgsql-bugs@postgresql.org; Mon, 12 Mar 2012 15:23:58 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q2CFNiRA027252; Mon, 12 Mar 2012 11:23:44 -0400 (EDT) To: Robert Haas cc: maxim.boguk@gmail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #6513: explain (analyze, buffers) and toasted fields In-reply-to: References: Comments: In-reply-to Robert Haas message dated "Mon, 12 Mar 2012 11:07:55 -0400" Date: Mon, 12 Mar 2012 11:23:44 -0400 Message-ID: <27251.1331565824@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201203/88 X-Sequence-Number: 32649 Robert Haas 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