Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VI2CY-00010R-EF for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Sep 2013 20:00:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VI2CX-0008Rv-Sr for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Sep 2013 20:00:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VI2CW-0008RK-HA for pgsql-hackers@postgresql.org; Fri, 06 Sep 2013 20:00:16 +0000 Received: from 99-153-64-76.uvs.austtx.sbcglobal.net ([99.153.64.76] helo=noel.decibel.org) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VI2CR-0003Gt-Dq for pgsql-hackers@postgresql.org; Fri, 06 Sep 2013 20:00:14 +0000 Received: from decina.local (rrcs-67-79-71-90.sw.biz.rr.com [67.79.71.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by noel.decibel.org (Postfix) with ESMTPSA id 034C06D45D; Fri, 6 Sep 2013 20:00:04 +0000 (UTC) Message-ID: <522A3442.3020507@nasby.net> Date: Fri, 06 Sep 2013 15:00:02 -0500 From: Jim Nasby User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Gavin Flower CC: Robert Haas , Bruce Momjian , Peter Geoghegan , Tom Lane , Andrew Dunstan , PostgreSQL-development Subject: Re: [PERFORM] encouraging index-only scans References: <50C8F1EC.9010801@dunslane.net> <15321.1355347953@sss.pgh.pa.us> <50C90154.8060103@dunslane.net> <50C904DB.9090305@dunslane.net> <20121213024837.GB22363@momjian.us> <23298.1355370698@sss.pgh.pa.us> <20130904205655.GR21874@momjian.us> <20130906001437.GA29264@momjian.us> <52292FFC.8020708@archidevsys.co.nz> In-Reply-To: <52292FFC.8020708@archidevsys.co.nz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.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 9/5/13 8:29 PM, Gavin Flower wrote: > How about a 'VACUUM AFTER' command (part of the 'BEGIN' transaction syntax?) that would: > > 1. only be valid in a transaction > 2. initiate a vacuum after the current transaction completed > 3. defer any vacuum triggered due to other criteria > > If the transaction was rolled back: then if there was a pending vacuum, due to other reasons, it would then be actioned. > > On normal transaction completion, then if there was a pending vacuum it would be combined with the one in the transaction. > > Still would need some method of ensuring any pending vacuum was done if the transaction hung, or took too long. I *really* like the idea of BEGIN VACUUM AFTER, but I suspect it would be of very limited usefulness if it didn't account for currently running transactions. I'm thinking we add a vacuum_after_xid field somewhere (pg_class), and instead of attempting to vacuum inside the backend at commit time the transaction would set that field to it's XID unless the field already had a newer XID in it. autovac would then add all tables where vacuum_after_xid < the oldest running transaction to it's priority list. -- Jim C. Nasby, Data Architect jim@nasby.net 512.569.9461 (cell) http://jim.nasby.net -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers