Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 493D737EB72 for ; Sun, 15 Jul 2012 19:37:37 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SqXRS-0000T7-DD for pgsql-hackers@postgresql.org; Sun, 15 Jul 2012 22:37:36 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q6FMbCft024159; Sun, 15 Jul 2012 18:37:12 -0400 (EDT) From: Tom Lane To: Jeff Janes cc: pgsql-hackers , Daniel Farina , Craig Ringer , =?ISO-8859-1?Q?Harold_A=2E_Gim=E9nez?= Subject: Re: [PERFORM] DELETE vs TRUNCATE explanation In-reply-to: <19949.1342376967@sss.pgh.pa.us> References: <4FFCCAC4.4030503@ringerc.id.au> <23853.1342015548@sss.pgh.pa.us> <32078D4B40DD40ECB739D0ECD7D95996@gmail.com> <19949.1342376967@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sun, 15 Jul 2012 14:29:27 -0400" Date: Sun, 15 Jul 2012 18:37:12 -0400 Message-ID: <24158.1342391832@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/685 X-Sequence-Number: 211368 ... btw, in the penny wise and pound foolish department, I observe that smgrdounlink calls mdunlink separately for each possibly existing fork of a relation to be dropped. That means we are queuing a separate fsync queue entry for each fork, and could immediately save a factor of four in FORGET_RELATION_FSYNC traffic if we were to redefine those queue entries as applying to all forks. The only reason to have a per-fork variant, AFAICS, is for smgrdounlinkfork(), which is used nowhere and exists only because I was too chicken to remove the functionality outright in commit ece01aae479227d9836294b287d872c5a6146a11. But given that we know the fsync queue can be a bottleneck, my vote is to refactor mdunlink to apply to all forks and send only one message. I am also wondering whether it's really necessary to send fsync request messages for backend-local relations. If rnode.backend says it's local, can't we skip sending the fsync request? All local relations are flush-on-crash anyway, no? regards, tom lane