Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 94B7564FD10 for ; Thu, 28 Aug 2008 14:25:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 72170-03 for ; Thu, 28 Aug 2008 14:25:55 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gattler.pezone.net (eisentraut.org [85.214.91.16]) by postgresql.org (Postfix) with ESMTP id D2E0A64FCBD for ; Thu, 28 Aug 2008 14:25:55 -0300 (ADT) Received: from dhcp-eesp05-101-159.Finland.Sun.COM (gmp-ea-fw-1.sun.com [192.18.1.36]) by gattler.pezone.net (Postfix) with ESMTP id 4DF3115F0806; Thu, 28 Aug 2008 17:25:53 +0000 (UTC) Message-ID: <48B6E0A6.7030201@gmx.net> Date: Thu, 28 Aug 2008 20:30:14 +0300 From: Peter Eisentraut User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: =?UTF-8?B?RGV2cmltIEfDnE5Ew5xa?= CC: pgsql-docs Subject: Re: Doc patch for truncate.sgml References: <1219936487.3376.14.camel@laptop.gunduz.org> In-Reply-To: <1219936487.3376.14.camel@laptop.gunduz.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200808/19 X-Sequence-Number: 4959 Devrim GÜNDÜZ wrote: > Attached is a doc patch for truncate.sgml. It improves info for > TRUNCATE. Thanks to Andrew Sullivan for pointing out this. > --- 34,44 ---- > DELETE on each table, but since it does not actually > scan the tables it is faster. Furthermore, it reclaims disk space > immediately, rather than requiring a subsequent VACUUM > ! operation. This is most useful on large tables. Also, > ! TRUNCATE rewrites system catalogue entries for > ! that table, which makes running ANALYZE on a > ! freshly-truncated table is a bad idea, because the statistics will be > ! updated to indicate that the table is truly empty. > > If the table is in fact empty, why is it a bad idea to let the statistics reflect that? I think you are making assumptions about certain usage patterns that do not always have to be true, and that are not written down anyway.