Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id BC3A91FEAA7F for ; Wed, 11 Jul 2012 22:24:05 -0300 (ADT) Received: from mail-pb0-f46.google.com ([209.85.160.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Sp88R-00026A-9Y for pgsql-performance@postgresql.org; Thu, 12 Jul 2012 01:24:04 +0000 Received: by pbbrp8 with SMTP id rp8so2864107pbb.19 for ; Wed, 11 Jul 2012 18:23:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=gx1xUZ7CkwUfg2TDoe7U7N3fyACGP/QhQjCfDaK3Qs4=; b=Uk2NksKSsmYAcUSva5EFUJ+OZXpAdDc2np1/C3lgjCrLBfqS339bIIbrcr+xytSWub Dgnv2W7+kHpaq1dszbRjyZmWazHRrlkKAXy/XZNQnHuAkVkgtHxk+FzFA9vNNseZzjy6 NVtOXxejc/H6zpA6yuVt68snzn4cmPVgdp12vNaiL8nih7EUvSXvHVt4oBqrNYXHqgp/ 6LDp8cg8VTSYvxxPSq3iCXexTshcrg59xrOpVc1ATGeimLLRQZOGcot9mElD6jTIOFyE zP+cgEhvVe+FRNRAEF1XWODKXXVBohOWhiaSQE0FuEeytVewHvFl0tLTB5J6eCgzAr55 hd8Q== Received: by 10.68.190.40 with SMTP id gn8mr801491pbc.118.1342056227981; Wed, 11 Jul 2012 18:23:47 -0700 (PDT) Received: from ayaki.localdomain (office1.postnewspapers.com.au. [150.101.171.128]) by mx.google.com with ESMTPS id ot4sm2732431pbb.65.2012.07.11.18.23.44 (version=SSLv3 cipher=OTHER); Wed, 11 Jul 2012 18:23:47 -0700 (PDT) Message-ID: <4FFE2704.7020106@ringerc.id.au> Date: Thu, 12 Jul 2012 09:23:16 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: Matthew Woodcraft CC: pgsql-performance@postgresql.org Subject: Re: DELETE vs TRUNCATE explanation References: <20120711181037.GF11608@golux.woodcraft.me.uk> In-Reply-To: <20120711181037.GF11608@golux.woodcraft.me.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkgvlBBFJPFTmpbFCxqC2dqIjPKi/KpskrX8VOTQNJIJT0o21BFMcszNRRP9V45yjTgnWKr X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/146 X-Sequence-Number: 47327 On 07/12/2012 02:10 AM, Matthew Woodcraft wrote: > I think a documentation change would be worthwhile. At the moment the > TRUNCATE page says, with no caveats, that it is faster than > unqualified DELETE. +1 to updating the docs to reflect the fact that TRUNCATE may have a higher fixed cost than DELETE FROM table; but also prevents bloat. It's a weird little corner case, but with database-backed unit testing it's going to become a more significant one whether or not it feels like it makes any sense. -- Craig Ringer