Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 07A7665063C for ; Mon, 14 Jul 2008 12:23:56 -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 93620-03 for ; Mon, 14 Jul 2008 12:23:52 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 34BC56500E5 for ; Mon, 14 Jul 2008 12:23:47 -0300 (ADT) 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 m6EFNkDm008742; Mon, 14 Jul 2008 11:23:46 -0400 (EDT) To: "Pavan Deolasee" cc: "Pgsql Hackers" Subject: Re: [PATCHES] VACUUM Improvements - WIP Patch In-reply-to: <2e78013d0807132050j16cdc558s4dc3f889371a937d@mail.gmail.com> References: <2e78013d0806092232h6ca15ffejcbcd24e88401308f@mail.gmail.com> <21751.1215883933@sss.pgh.pa.us> <2e78013d0807132050j16cdc558s4dc3f889371a937d@mail.gmail.com> Comments: In-reply-to "Pavan Deolasee" message dated "Mon, 14 Jul 2008 09:20:02 +0530" Date: Mon, 14 Jul 2008 11:23:45 -0400 Message-ID: <8741.1216049025@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/663 X-Sequence-Number: 120923 "Pavan Deolasee" writes: > (taking the discussions to -hackers) > On Sat, Jul 12, 2008 at 11:02 PM, Tom Lane wrote: >> (2) It achieves speedup of VACUUM by pushing work onto subsequent >> regular accesses of the page, which is exactly the wrong thing. >> Worse, once you count the disk writes those accesses will induce it's >> not even clear that there's any genuine savings. > Well in the worst case that is true. But in most other cases, the > second pass work will be combined with other normal activities and the > overhead will be shared, at least there is a chance for that. I think > there is a chance for delaying the work until there is any real need > for that e.g. INSERT or UPDATE on the page which would require a free > line pointer. That's just arm-waving: right now, pruning will be done by the next *reader* of the page, whether or not he has any intention of *writing* it. With no proposal on the table for improving that situation, I don't see any credibility in arguing for over-complicating VACUUM on the grounds that it might happen someday. In any case, the work that is supposed to be done by VACUUM is being pushed to a foreground query, which I find to be completely against our design principles. >> It strikes me that what you are trying to do here is compensate for >> a bad decision in the HOT patch, which was to have VACUUM's first >> pass prune/defrag a page even when we know we are going to have to >> come back to that page later. What about trying to fix things so >> that if the page contains line pointers that need to be removed, >> the first pass doesn't dirty it at all, but leaves all the work >> to be done at the second visit? > I am not against this idea. Just that it still requires us double scan > of the main table and that's exactly what we are trying to avoid with > this patch. The part of the argument that I found convincing was trying to reduce the write traffic (especially WAL log output), not avoiding a second read. And the fundamental point still remains: the work should be done in background, not foreground. regards, tom lane