Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 049C063311B for ; Wed, 31 Mar 2010 04:42:42 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 71491-04 for ; Wed, 31 Mar 2010 07:42:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ww0-f46.google.com (mail-ww0-f46.google.com [74.125.82.46]) by mail.postgresql.org (Postfix) with ESMTP id 1F362632FAB for ; Wed, 31 Mar 2010 04:42:30 -0300 (ADT) Received: by wwb17 with SMTP id 17so211302wwb.19 for ; Wed, 31 Mar 2010 00:42:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=b297WD+2+fqG7i2MHMKqa5nhDQ5YcKo4vmo1BzIDVaY=; b=pCUpnjrDZ1FUAEQHnvATd1ZSBwP5ba/+WMIOfqfTL//a79Bt0xvS0eTqxdQwmfunZ1 A0yardsz/M3/yBBUlNi+KhRPa2I8/3uDZKKHVqtMODCfu2DD2Y6WA7WVU/ogQpaGa3SP CbO2HEofcOxh2lxzTf1Z2bNPV/+6aDY0iA+Nk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=O+fNhB5/w1bWkDluSMuwInOwBE8wx23eplTrVeWXCCrKy6E9EqI1ZWxtIGKiCVtGGV Q+Too1VC9M1dq3HxXsXFvv1y4wUe8rPOuBzL2jWUjhIVD2CpPKXS2qMqwzXtxGq7i3nL 4xRZr7aN2+Qi8dmG8BgYbh/lpquL3a9LRzIvI= MIME-Version: 1.0 Received: by 10.216.184.65 with HTTP; Wed, 31 Mar 2010 00:42:29 -0700 (PDT) In-Reply-To: <26236.1269971456@sss.pgh.pa.us> References: <26236.1269971456@sss.pgh.pa.us> Date: Wed, 31 Mar 2010 11:42:29 +0400 Received: by 10.216.86.66 with SMTP id v44mr1269687wee.163.1270021349542; Wed, 31 Mar 2010 00:42:29 -0700 (PDT) Message-ID: Subject: Re: temp table "on commit delete rows": transaction overhead From: Artiom Makarov To: Tom Lane Cc: pgsql-performance@postgresql.org Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.745 tagged_above=-10 required=5 tests=AWL=1.854, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201004/47 X-Sequence-Number: 38297 2010/3/30 Tom Lane : > I don't recall any operations at transaction start for such tables, > but there may be some. > Both in =F3ommitTransaction(void) and PrepareTransaction(void) we can see PreCommit_on_commit_actions() call; Here PreCommit_on_commit_actions() case ONCOMMIT_DELETE_ROWS: oids_to_truncate =3D lappend_oid(oids_to_truncate, oc->relid); break; As a my opinion, the same action taked place at transaction start and commi= t. To truncate rows of any temp tables, both changed and unchanged(!) after transaction looks as little reinsurance. Well. But why do the same action _before_ any transaction?