Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id CCE6265018B for ; Mon, 21 Jul 2008 11:45:40 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 73875-01-6 for ; Mon, 21 Jul 2008 11:45:28 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from macnews.de (webmail.macnews.de [193.164.134.233]) by postgresql.org (Postfix) with ESMTP id 268826501C6 for ; Mon, 21 Jul 2008 11:45:20 -0300 (ADT) Received: from [84.253.63.109] (account pl30411 HELO [192.168.113.215]) by macnews.de (CommuniGate Pro SMTP 5.0.11) with ESMTPA id 93317541 for pgsql-performance@postgresql.org; Mon, 21 Jul 2008 16:45:16 +0200 Message-ID: <4884A0F6.2000501@apache.org> Date: Mon, 21 Jul 2008 16:45:10 +0200 From: Andreas Hartmann User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Less rows -> better performance? References: <48846A02.7090702@apache.org> <48846DA3.2090308@archonet.com> <4884722A.1000405@apache.org> <1d4e0c10807210432v45c6272awb1ea13974747de54@mail.gmail.com> In-Reply-To: <1d4e0c10807210432v45c6272awb1ea13974747de54@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/182 X-Sequence-Number: 30782 Guillaume Smet schrieb: > On Mon, Jul 21, 2008 at 1:25 PM, Andreas Hartmann wrote: >> SELECT pg_database.datname, >> pg_size_pretty(pg_database_size(pg_database.datname)) AS size >> FROM pg_database where pg_database.datname = 'vvz_live_1'; >> >> datname | size >> ---------------+--------- >> vvz_live_1 | 2565 MB >> >> I wonder why the actual size is so much bigger than the data-only dump - is >> this because of index data etc.? > > More probably because the database is totally bloated. Do you run > VACUUM regularly or did you set up autovacuum? Thanks for the hint! I just verified that the autovacuum property is enabled. I did the following to prepare the tests: - setup two test databases, let's call them db_all and db_current - import the dump from the live DB into both test DBs - delete the old semester data from db_current, leaving only the current data Both test DBs were 600 MB large after this. I did a VACUUM FULL ANALYZE on both of them now. db_all didn't shrink significantly (only 1 MB), db_current shrunk to 440 MB. We're using quite a lot of indexes, I guess that's why that much data are allocated. -- Andreas -- Andreas Hartmann, CTO BeCompany GmbH http://www.becompany.ch Tel.: +41 (0) 43 818 57 01