Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Te2yx-0006Tw-DC for pgsql-performance@arkaria.postgresql.org; Thu, 29 Nov 2012 12:12:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Te2yw-0007XK-7h for pgsql-performance@arkaria.postgresql.org; Thu, 29 Nov 2012 12:12:42 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Te2yv-0007XE-5J for pgsql-performance@postgresql.org; Thu, 29 Nov 2012 12:12:41 +0000 Received: from moutng.kundenserver.de ([212.227.17.10]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Te2yn-0004Vi-Gz for pgsql-performance@postgresql.org; Thu, 29 Nov 2012 12:12:40 +0000 Received: from anarazel.de (p5DDC4F1E.dip.t-dialin.net [93.220.79.30]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0M40YM-1TLyCF3GuA-00rPt3; Thu, 29 Nov 2012 13:12:31 +0100 Received: by anarazel.de (Postfix, from userid 1000) id F3E881C00E6; Thu, 29 Nov 2012 13:12:28 +0100 (CET) Date: Thu, 29 Nov 2012 13:12:28 +0100 From: Andres Freund To: Pavan Deolasee Cc: Guillaume Cottenceau , pgsql-performance@postgresql.org Subject: Re: 9.2.1 & index-only scans : abnormal heap fetches after VACUUM FULL Message-ID: <20121129121228.GC15483@awork2.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Provags-ID: V02:K0:vWLVXHU4FwurNJh9KZBLLB7ubthnM9AiZt8EFnP802e FDj5t9kqHcDcRd692bIBb1x4JEkd/UiD+RjdTrpYgsMjA9jkqQ N21+CUbaSquxuqR+x+AJzf3MtBw7OUgNkUkqEEBi0+egLkpkPZ 8ORaFaCDeLUQjKjs07wDJFI595Jdh6ajDvyn92BgeUStcTiZj7 6V8SG4md/OiLuxuQc9W/lUoG79U4TpHNwErIJv0CmP3mjpJYkX INdpvzT6aoK82/A9Bq3vDbyDYeNgBRp7EcloYejQAB5QIvn02w jwgF+vDk2kbZA53x2FOG0LkCF+5sQpaVzBAK/K1+1qjrPrO/oi DzEesT8plmOyfzNTBuCMboBWZqX1rEBstA0/iDjK+ X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 2012-11-29 17:20:01 +0530, Pavan Deolasee wrote: > On Thu, Nov 29, 2012 at 5:03 PM, Guillaume Cottenceau wrote: > > > Hello, > > > > I am toying around with 9.2.1, trying to measure/determine how > > index-only scans can improve our performance. > > > > A small script which is attached to this mail, shows that as long > > as the table has been VACUUM FULL'd, there is a unusual high > > amount of heap fetches. It is strange that the visibilitymap_test > > predicate fails in these situations, is the visibility map > > somehow trashed in this situation? It should not, or at least the > > documentation[1] should state it (my understanding is that vacuum > > full does *more* than vacuum, but nothing less) (note to usual > > anti vacuum full trollers: I know you hate vacuum full). > > > > > I don't find it very surprising given that VACUUM FULL is now implemented > as a CLUSTER command which rewrites the entire heap, thus invalidating all > the visibility map info whatsoever. Me neither. > Now can CLUSTER or VACUUM FULL recreate the visibility map with all bits > set to visible, thats an entirely different question. I don't think it can, > but then I haven't thought through this completely. It can't set everything to visible as it also copies RECENTLY_DEAD tuples and tuples which are not yet visible to other transactions, but it should be relatively easy to keep enough information about whether it can set the current page to all visible. At least for the data in the main relation, the toast tables are a different matter. Just tracking whether the page in rewriteheap.c's state->rs_buffer contains only tuples that are clearly visible according to the xmin horizon seems to be enough. The current effect of resetting the VM has the disadvantage of making the next autovacuum basically a full table vacuum without any benefits... Greetings, Andres -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance