X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2897B528C8 for ; Wed, 25 May 2005 00:00:41 -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 60431-01 for ; Wed, 25 May 2005 03:00:39 +0000 (GMT) Received: from server07.icaen.uiowa.edu (server07.icaen.uiowa.edu [128.255.17.47]) by svr1.postgresql.org (Postfix) with ESMTP id C77AF528C2 for ; Wed, 25 May 2005 00:00:37 -0300 (ADT) Received: from server11.icaen.uiowa.edu (server11.icaen.uiowa.edu [128.255.17.51]) by server07.icaen.uiowa.edu (8.13.3/8.12.9) with ESMTP id j4P30a9R023779; (envelope-from ) Tue, 24 May 2005 22:00:36 -0500 (CDT) Received: from [192.168.1.11] (12-215-118-172.client.mchsi.com [12.215.118.172]) (authenticated user=jfmeinel) by server11.icaen.uiowa.edu (8.13.2/smtp-serv-1.7) with ESMTP id j4P30XbM003824 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256); (envelope-from ) Tue, 24 May 2005 22:00:35 -0500 (CDT) Message-ID: <4293EA52.20005@arbash-meinel.com> Date: Tue, 24 May 2005 22:00:34 -0500 From: John A Meinel User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: SpaceBallOne Cc: pgsql-performance@postgresql.org Subject: Re: Can anyone explain this: duplicate dbs. References: <4293E553.6070400@arbash-meinel.com> In-Reply-To: X-Enigmail-Version: 0.91.0.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig44F58C7791E1887BD94AC986" X-Virus-Scanned: ClamAV version 0.83, clamav-milter version 0.83 on clamav.icaen.uiowa.edu X-Virus-Scanned: ClamAV version 0.83, clamav-milter version 0.83 on clamav.icaen.uiowa.edu X-Virus-Status: Clean X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200505/383 X-Sequence-Number: 12547 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig44F58C7791E1887BD94AC986 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit SpaceBallOne wrote: >> What version of postgres? > > > 8.0.2 ... but I think I've seen this before on 7.3 ... > >> There are a few possibilities. If you are having a lot of updates to the >> table, you can get index bloat. And vacuum doesn't fix indexes. You have >> to "REINDEX" to do that. Though REINDEX has the same lock that VACUUM >> FULL has, so you need to be a little careful with it. > > >> Probably better is to do CLUSTER, as it does a REINDEX and a sort, so >> your table ends up nicer when you are done. > > > Thanks, will try those next time this problem crops up (i just deleted > / recreated the database to speed things for its users in the office > ... probably should have held off to see if I could find a solution > first!). > > Yes, the database / table-in-question does have a lot of updates, > deletes, and new rows (relatively speaking for a small business). > > Would CLUSTER / REINDEX still have an effect if our queries were done > via sequential scan? This is a old database (as in built by me when i > was just starting to learn unix / postgres) so the database design is > pretty horrible (little normalisation, no indexes). Well, my first recommendation is to put in some indexes. :) They are relatively easy to setup and can drastically improve select performance. What version of postgres are you using? What does it say at the end of "VACUUM FULL ANALYZE VERBOSE", that should tell you how many free pages were reclaimed and how big your free space map should be. If you only did 1 VACUUM FULL, you might try another, as it sounds like your tables aren't properly filled. I'm pretty sure vacuum only removes empty pages/marks locations for the free space map so they can be re-used, while vacuum full will move entries around to create free pages. It sounds like it didn't do it properly. But even so, CLUSTER is still your friend, as it allows you to "presort" the rows in your tables. > > Have taken Chris's advice onboard too and setup cron to do a vacuumdb > hourly instead of my weekly vacuum. > > Cheers, > > Dave. > > John =:-> --------------enig44F58C7791E1887BD94AC986 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (Cygwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCk+pSJdeBCYSNAAMRAq1LAJ9wtuOuGBxaVGPZ47cie/X0l/N+6QCggXA9 xZ911qobTXG6JwsejW531u8= =nJGz -----END PGP SIGNATURE----- --------------enig44F58C7791E1887BD94AC986--