Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 9CA18B5DC01 for ; Wed, 20 Jul 2011 16:39:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 60934-05 for ; Wed, 20 Jul 2011 19:39:27 +0000 (UTC) X-Greylist: delayed 00:05:29.349083 by SQLgrey-1.7.6 Received: from pingwin.eu.org (pingwin.eu.org [83.168.126.233]) by mail.postgresql.org (Postfix) with ESMTP id 7040AB5DC29 for ; Wed, 20 Jul 2011 16:39:26 -0300 (ADT) Received: from pingwin.eu.org (localhost [127.0.0.1]) by pingwin.eu.org (pingwin.eu.org) with ESMTP id 2696AC08C; Wed, 20 Jul 2011 21:33:54 +0200 (CEST) Received: from [172.16.2.14] (laptop2.openvpn.pingwin.eu.org [172.16.2.14]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by pingwin.eu.org (pingwin.eu.org) with ESMTPSA id 0E773C08B; Wed, 20 Jul 2011 21:33:54 +0200 (CEST) Message-ID: <4E272DA1.6080205@e-list.pingwin.eu.org> Date: Wed, 20 Jul 2011 21:33:53 +0200 From: Andrzej Nakonieczny User-Agent: Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: pgsql-performance@postgresql.org CC: Jose Ildefonso Camargo Tolosa , Robert Haas , Craig James Subject: Re: Large rows number, and large objects References: <4DFE1A88.4000304@emolecules.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AV-Checked: ClamAV X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-3.093 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-1.193 X-Spam-Level: X-Archive-Number: 201107/202 X-Sequence-Number: 44414 W dniu 20.07.2011 17:57, Jose Ildefonso Camargo Tolosa pisze: [...] > Many of the advantages of partitioning have to do with maintenance > tasks. For example, if you gather data on a daily basis, it's faster > to drop the partition that contains Thursday's data than it is to do a > DELETE that finds the rows and deletes them one at a time. And VACUUM > can be a problem on very large tables as well, because only one VACUUM > can run on a table at any given time. If the frequency with which the > table needs to be vacuumed is less than the time it takes for VACUUM > to complete, then you've got a problem. > > > And.... pg_largeobject table doesn't get vacuumed? I mean, isn't that > table just as any other table? Vacuum is a real problem on big pg_largeobject table. I have 1.6 TB database mostly with large objects and vacuuming that table on fast SAN takes about 4 hours: now | start | time | datname | current_query ---------------------+---------------------+----------+------------+---------------------------------------------- 2011-07-20 20:12:03 | 2011-07-20 16:21:20 | 03:50:43 | bigdb | autovacuum: VACUUM pg_catalog.pg_largeobject (1 row) LO generates a lot of dead tuples when object are adding: relname | n_dead_tup ------------------+------------ pg_largeobject | 246731 Adding LO is very fast when table is vacuumed. But when there is a lot of dead tuples adding LO is very slow (50-100 times slower) and eats 100% of CPU. It looks that better way is writing object directly as a bytea on paritioned tables althought it's a bit slower than LO interface on a vacuumed table. Regards, Andrzej