Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YvuKR-0005C3-Cx for pgsql-performance@arkaria.postgresql.org; Fri, 22 May 2015 21:18:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YvuKQ-0002xV-HP for pgsql-performance@arkaria.postgresql.org; Fri, 22 May 2015 21:18:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YvuKP-0002xM-DY for pgsql-performance@postgresql.org; Fri, 22 May 2015 21:18:01 +0000 Received: from mail-bn1bon0090.outbound.protection.outlook.com ([157.56.111.90] helo=na01-bn1-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1YvuKF-000071-Te for pgsql-performance@postgresql.org; Fri, 22 May 2015 21:18:00 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jim.Nasby@bluetreble.com; Received: from decina.local (70.113.16.71) by BLUPR11MB0673.namprd11.prod.outlook.com (25.163.216.143) with Microsoft SMTP Server (TLS) id 15.1.166.22; Fri, 22 May 2015 21:17:47 +0000 Message-ID: <555F9CF8.8000708@BlueTreble.com> Date: Fri, 22 May 2015 16:17:44 -0500 From: Jim Nasby User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "Muthusamy, Sivaraman" , "pgsql-performance@postgresql.org" Subject: Re: How to clean/truncate / VACUUM FULL pg_largeobject without (much) downtime? References: In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [70.113.16.71] X-ClientProxiedBy: SN1PR0701CA0029.namprd07.prod.outlook.com (25.162.96.39) To BLUPR11MB0673.namprd11.prod.outlook.com (25.163.216.143) X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR11MB0673; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(520002)(5005006)(3002001); SRVR:BLUPR11MB0673; BCL:0; PCL:0; RULEID:; SRVR:BLUPR11MB0673; X-Forefront-PRVS: 058441C12A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(199003)(377454003)(479174004)(24454002)(189002)(51704005)(189998001)(101416001)(5001860100001)(5001960100002)(105586002)(19580395003)(80316001)(65806001)(2950100001)(92566002)(42186005)(46102003)(64706001)(47776003)(87266999)(122386002)(107886002)(54356999)(87976001)(59896002)(50986999)(33656002)(65816999)(76176999)(23746002)(86362001)(15975445007)(83506001)(64126003)(4001350100001)(97736004)(62966003)(50466002)(36756003)(40100003)(68736005)(77156002)(5001830100001)(81156007)(5001770100001)(65956001)(66066001)(4001540100001)(2501003)(106356001)(85282002)(217873001)(336755003)(18886065003); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR11MB0673; H:decina.local; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: bluetreble.com does not designate permitted sender hosts) X-OriginatorOrg: bluetreble.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2015 21:17:47.2227 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR11MB0673 X-Pg-Spam-Score: -3.0 (---) 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 5/11/15 4:55 AM, Muthusamy, Sivaraman wrote: > Hi Group, > > Facing a problem where pg_catalog.pg_largetobject has been growing fast > recently, in last two weeks. The actual data itself, in user tables, is > about 60GB, but pg_catalog.pg_largeobject table is 200GB plues. Please > let me know how to clean/truncate this table without losing any user > data in other table. Autovacuum should be taking care of it for you, though you could also try a manual vacuum (VACUUM pg_largeobject;). > With regards to this pg_largeobject, I have the following questions: > > -What is this pg_largetobject ? It stores large objects http://www.postgresql.org/docs/9.4/static/lo-interfaces.html > -what does it contain ? tried PostgreSQL documentation and lists, but > could not get much from it. > > -why does it grow ? > > -Was there any configuration change that may have triggered this to > grow? For last one year or so, there was no problem, but it started > growing all of sudden in last two weeks. The only change we had in last > two weeks was that we have scheduled night base-backup for it and > auto-vacuum feature enabled. Changes to autovacuum settings could certainly cause changes. Long-running transactions would prevent cleanup, as would any prepared transactions (which should really be disabled unless you explicitly need them). > -pg_largeobject contains so many duplicate rows (loid). Though there are > only about 0.6 million rows (LOIDs), but the total number of rows > including duplicates are about 59million records. What are all these ? Each row can only be ~2KB wide, so any LO that's larger than that will be split into multiple rows. -- Jim Nasby, Data Architect, Blue Treble Consulting Data in Trouble? Get it in Treble! http://BlueTreble.com -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance