Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 8B443F497BC for ; Mon, 27 Feb 2012 11:01:28 -0400 (AST) Received: from smtp2.peak6.com ([38.98.137.9]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S224t-0004Y0-BR for pgsql-performance@postgresql.org; Mon, 27 Feb 2012 15:01:27 +0000 X-AuditID: 0a02cb1e-b7bceae0000009d3-aa-4f4b9ac0e1a4 Message-ID: <4F4B9AB9.6000900@peak6.com> Date: Mon, 27 Feb 2012 09:01:13 -0600 From: Shaun Thomas Reply-To: Organization: Peak6 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Andrew Dunstan CC: "Reuven M. Lerner" , Subject: Re: Very long deletion time on a 200 GB database References: <4F45FB55.1020600@lerner.co.il> <4F47C6C4.6030102@pinpointresearch.com> <4F4B39EF.2080004@lerner.co.il> <4F4B9721.6050808@peak6.com> <4F4B9907.60008@dunslane.net> In-Reply-To: <4F4B9907.60008@dunslane.net> Content-Type: text/plain; charset="UTF-8"; format=flowed content-transfer-encoding: 7bit X-Originating-IP: [10.10.107.46] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBIsWRmVeSWpSXmKPExsXCxcQroXtglre/wcMVvBabPl5gs7g+8xyz xftHu5kcmD16Xl5h9Jj67AGLx4V909gDmKMaGG0S8/LySxJLUhVSUouTbZUCXB29zRRcMouT cxIzc1OLlBQyU2yVzJQUCnISk1NzU/NKbJUSCwpS81KU7LgUMIANUFlmnkJqXnJ+SmZeuq2S Z7C/roWFqaWuoZJdPBaQ0MSS0XZqO0vBVo6Ka21LWRsYb7B1MXJySAiYSDS0zmKCsMUkLtxb DxbnFdCQOHzyHiOIzSKgKvF02k4wm01ATWLh7ptgtpCArMT+VedYQWx+AWGJfR+amLsYOThE BcIkFrzzhBgjKHFy5hMWEFsEaOT5r4fASpgFgiTmNAiDhIUFnCVOPT7H3sXIBTRxHaPEzvkv 2UESnAJaEhuvHwPrZRawkFj85iA7hC0vsf3tHGaIE+Qk7jQ8h3pFQWLO1XaWCYxCs5CsnoWk fRaS9gWMzKsYxYvLEpMzMs0KinNLCgz1ClITs8308lJLNjGCY/m03A7GFRcUDzEKcDAq8fAu eOzlL8SaWFZcmXuIUYKDWUmEVz/b21+INyWxsiq1KD++qDQntfgQoykwyCYyS4km5wPTTF5J vKGxoaWppbGZgZGJpYWSOG8rj62/kEA6MDVkp6YWpBbB9DFxcEo1MPpJBnC9Pe+nsywuatGM DJX2dSzTCzYGF3z/qu0leiXw8tu7ZTGJ5mpbI6M0X7RGqvnnKzwud1kzlWHqglxFPvnbnrwH LWcs4v16bsKnSe5hYnMP9uey6DWKPfjdfqLX6Mn3uxPWvP8UvrX9pv3vaYcvO5y5vpCT37lr lXy+lnDiMosw+frTLEosxRmJhlrMRcWJALPaYVT7AgAA X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/231 X-Sequence-Number: 46403 On 02/27/2012 08:53 AM, Andrew Dunstan wrote: > If he has autovacuum on he could well be just fine with his proposed > strategy. Or he could have tables partitioned by time and do the delete > by just dropping partitions. There are numerous way he could get this to > work. He isn't using partitions though. That's the whole reason for this thread. Having autovacuum turned on (which should be the case for 8.4 and above anyway) will not magically remove the old rows. VACUUM marks rows as dead/reusable, so INSERT and UPDATE statements will take the dead spots instead of creating new extents. Like I said, this will stop his tables from growing further so long as he keeps his maintenance functions running regularly from now on, but the existing rows he's trying to delete will never go away until he runs a CLUSTER or some other system of actually purging the dead rows. Notice how I don't suggest using VACUUM FULL. :) -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | Chicago IL, 60604 312-444-8534 sthomas@peak6.com ______________________________________________ See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email