Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id E58C4B5D8B2 for ; Sun, 29 May 2011 20:33:26 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 43359-03 for ; Sun, 29 May 2011 23:33:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pv0-f174.google.com (mail-pv0-f174.google.com [74.125.83.174]) by mail.postgresql.org (Postfix) with ESMTP id 9B6AFB5D803 for ; Sun, 29 May 2011 20:33:14 -0300 (ADT) Received: by pvg12 with SMTP id 12so1390100pvg.19 for ; Sun, 29 May 2011 16:33:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=LqIWaeM+AUbBkGsaE2tkgJmBD8lUSckOFpntP0hkzH8=; b=hM8jYhET1oSPEDz5GSluCh5MpaoqKDq+DIJ2JgF43dpo+OR/BaDFtT37Or4IPIlsp7 x51f2Mv+ctGV4BCdXSU6hlD8zRPAC7suHevzp13OGDetbdRifPiyfbQE1dq207yegA0G OHehYF8v/rLLmMuljJvYFbqv0EFiErlv96UmI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=JKymuBfSNtSEtZVKRTcwi7WvHOO0oBbTthIRSo4jpbxygJcOTLSaIiugf6+mcBmEeX XcraetB+W2kjf4aQeJhANUlpZQLsBLqAkChO1qXYbFvfCUBJ/1LJZcCNNRfPJNYK83n8 jxpRG3r2clMvyTx1KLQ0FU7Bcmqb1k6m3N4XY= Received: by 10.68.17.198 with SMTP id q6mr1572748pbd.287.1306711994088; Sun, 29 May 2011 16:33:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.50.135 with HTTP; Sun, 29 May 2011 16:32:54 -0700 (PDT) In-Reply-To: <19876.1306680027@sss.pgh.pa.us> References: <4DD28F73.6010108@25th-floor.com> <25017.1306291669@sss.pgh.pa.us> <4DDCA801.70805@25th-floor.com> <19738.1306338472@sss.pgh.pa.us> <22497.1306341699@sss.pgh.pa.us> <15043.1306423500@sss.pgh.pa.us> <25097.1306426982@sss.pgh.pa.us> <4DDE475B020000250003DD63@gw.wicourts.gov> <4DDE5033020000250003DD71@gw.wicourts.gov> <4DDE7EB8020000250003DDA8@gw.wicourts.gov> <9007.1306446600@sss.pgh.pa.us> <28116.1306609295@sss.pgh.pa.us> <11295.1306645848@sss.pgh.pa.us> <19876.1306680027@sss.pgh.pa.us> From: =?ISO-8859-1?Q?C=E9dric_Villemain?= Date: Mon, 30 May 2011 01:32:54 +0200 Message-ID: Subject: Re: [ADMIN] pg_class reltuples/relpages not updated by autovacuum/vacuum To: Tom Lane Cc: Greg Stark , Robert Haas , Kevin Grittner , Florian Helmberger , Alvaro Herrera , pgsql-hackers@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.898 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201105/1506 X-Sequence-Number: 188540 2011/5/29 Tom Lane : > =3D?ISO-8859-1?Q?C=3DE9dric_Villemain?=3D writes: >> 2011/5/29 Tom Lane : >>> OK, do you like the attached version of that logic? =A0(Other fragments >>> of the patch as before.) > >> The idea was that remove only one page from the VACUUM will prevent >> relfrozenxid update and reltuples (and relpages) update. >> Now, I beleive that once we've skip at least one page thanks to >> SKIP_PAGES_THRESHOLD, then we should be more agressive and remove as >> many as possible pages from the VACUUM, tks to the VM. > > That would require proof, not just suggestion. =A0Skipping pages will > defeat the OS read-ahead algorithm, and so could easily cost more than > reading them. Correct, it needs proof. Parenthesis: I did learn also that reading the first block of a file make read-ahead have its larger window from the beginning (the one that posix_fadvise_sequential set too), so remove those initial reads might be counter-productive also. But this is damn hard to benchmark because the read ahead is also influenced by memory pressure for example.