Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VN2zf-0001O5-Aa for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Sep 2013 15:51:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VN2ze-0001k1-PA for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Sep 2013 15:51:42 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VN2zd-0001jt-GH for pgsql-hackers@postgresql.org; Fri, 20 Sep 2013 15:51:41 +0000 Received: from moutng.kundenserver.de ([212.227.126.171]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VN2za-0005kC-MP for pgsql-hackers@postgresql.org; Fri, 20 Sep 2013 15:51:40 +0000 Received: from anarazel.de (p54AF452B.dip0.t-ipconnect.de [84.175.69.43]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0Lxfpr-1VzJJl0sXb-017GfT; Fri, 20 Sep 2013 17:51:34 +0200 Received: by anarazel.de (Postfix, from userid 1000) id 755F0100931; Fri, 20 Sep 2013 17:51:33 +0200 (CEST) Date: Fri, 20 Sep 2013 17:51:33 +0200 From: Andres Freund To: Robert Haas Cc: Jim Nasby , Bruce Momjian , Alvaro Herrera , Peter Geoghegan , Tom Lane , Andrew Dunstan , PostgreSQL-development Subject: Re: [PERFORM] encouraging index-only scans Message-ID: <20130920155133.GB12763@awork2.anarazel.de> References: <20130906170159.GB13158@momjian.us> <20130906191330.GA13193@momjian.us> <20130906222623.GC626072@alap2.anarazel.de> <20130907002908.GA12753@momjian.us> <20130907053449.GE626072@alap2.anarazel.de> <5238854F.5040708@nasby.net> <20130917231050.GD29545@awork2.anarazel.de> <20130919225929.GC11116@awork2.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Provags-ID: V02:K0:dGmtHH65X1Fewl3YMyqoe+nYX9c0AXAq2Ot3m1rvGXf mtUP6jJmQh1MKQjFlZ9UA0rkJXxhd2duz7OOxmIXJcd9Nd9+7+ NDhdLABOw3sFAKWWHlv/BtCkBuFL4vFeke/x4X+VBfQrUNvAcf q+Wo8nldHLBDa83t0wiFzwkUG7tsANhmOPlZCrYtE46ZIKqX/w xn7BlwmvSNDdXYW2Ggu0cxIowWNGxTSdzrMf62gCO2a8Oab/IJ Golv84X7fHsyEiDJT581T6/78jFYiCbWLBTQMAZNSes8xCVxMA 7/hBVi29akrp64kDQJoI+aV44IIn+3cjLr4RdOvtRSS9x8TKWu /fF3nn7xi9gM93Wj2c2CjI20bHUkQHjIThu1g/dO6 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2013-09-20 11:30:26 -0400, Robert Haas wrote: > On Thu, Sep 19, 2013 at 6:59 PM, Andres Freund wrote: > > The reason I suggested keeping track of the xids of unremovable tuples > > is that the current logic doesn't handle that at all. We just > > unconditionally set n_dead_tuples to zero after a vacuum even if not a > > single row could actually be cleaned out. Which has the effect that we > > will not start a vacuum until enough bloat (or after changing this, new > > inserts) has collected to start vacuum anew. Which then will do twice > > the work. > > > > Resetting n_dead_tuples to the actual remaining dead tuples wouldn't do > > much good either - we would just immediately trigger a new vacuum the > > next time we check, even if the xmin horizon is still the same. > > One idea would be to store the xmin we used for the vacuum somewhere. > Could we make that part of the pgstats infrastructure? Or store it in > a new pg_class column? Then we could avoid re-triggering until it > advances. Or, maybe better, we could remember the oldest XID that we > weren't able to remove due to xmin considerations and re-trigger when > the horizon passes that point. I suggested a slightly more complex variant of this upthread: http://archives.postgresql.org/message-id/20130907053449.GE626072%40alap2.anarazel.de Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers