X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E8A97DB09A for ; Thu, 27 Oct 2005 18:36:49 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 41521-09 for ; Thu, 27 Oct 2005 21:36:47 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 27986DB0EE for ; Thu, 27 Oct 2005 18:36:48 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j9RLaaiP024261; Thu, 27 Oct 2005 17:36:36 -0400 (EDT) To: Martin Lesser Cc: pgsql-performance@postgresql.org, Denis Subject: Re: Reasons and drawbacks for unused item pointers (was: Update using primary key slow) In-reply-to: <87y84eznb0.fsf_-_@nb-aspire.bettercom.de> References: <19722.1130429883@sss.pgh.pa.us> <23322.1130442063@sss.pgh.pa.us> <87y84eznb0.fsf_-_@nb-aspire.bettercom.de> Comments: In-reply-to Martin Lesser message dated "Thu, 27 Oct 2005 23:01:55 +0200" Date: Thu, 27 Oct 2005 17:36:36 -0400 Message-ID: <24260.1130448996@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.006 required=5 tests=[AWL=0.006] X-Spam-Score: 0.006 X-Spam-Level: X-Archive-Number: 200510/431 X-Sequence-Number: 15199 Martin Lesser writes: > What causes this "unused item pointers" and which impact do they have > regarding performance? Those are item pointer slots that were once used but aren't used at the moment. VACUUM leaves an empty slot behind when it removes a dead tuple, and the slot is then available for re-use next time a tuple is created on that page. See http://developer.postgresql.org/docs/postgres/storage-page-layout.html The direct performance impact is really pretty minimal (and none at all on indexscans, AFAIR). The reason Denis' number drew my attention was that it implied that the table had gone un-vacuumed for awhile at some time in the past. His stats were showing about 64000 tuples deleted per vacuum pass, which would have created 64000 unused item pointers --- but in a steady-state situation those would be eaten up again by the time of the next vacuum. To have 1905028 unused pointers in a table with only 5106307 live entries suggests that at some point there were 1.9 million (or so) dead but not-yet-vacuumed tuples, which suggests insufficient vacuuming. regards, tom lane