Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id B26F79FB763 for ; Fri, 25 May 2007 05:52:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 08288-03 for ; Fri, 25 May 2007 05:51:55 -0300 (ADT) X-Greylist: delayed 00:22:13.676334 by SQLgrey-1.7.5 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 505179FB6EC for ; Fri, 25 May 2007 05:51:58 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from wp045.webpack.hosteurope.de (wp045.webpack.hosteurope.de [80.237.132.52]) by svr4.postgresql.org (Postfix) with ESMTP id 4D1A25AF03A for ; Fri, 25 May 2007 08:29:39 +0000 (GMT) Received: from d088150.adsl.hansenet.de ([80.171.88.150] helo=[192.168.1.44]); authenticated by wp045.webpack.hosteurope.de running ExIM using esmtpa id 1HrVAx-00056A-GA; Fri, 25 May 2007 10:29:31 +0200 Message-ID: <46569E6A.2060509@bastian-voigt.de> Date: Fri, 25 May 2007 10:29:30 +0200 From: Bastian Voigt User-Agent: Thunderbird 2.0.0.0 (X11/20070502) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Performance Problem with Vacuum of bytea table (PG 8.0.13) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-bounce-key: webpack.hosteurope.de; post@bastian-voigt.de; 1180081783; 3bb409bb; X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200705/487 X-Sequence-Number: 24877 Hi *, for caching large autogenerated XML files, I have created a bytea table in my database so that the cached files can be used by multiple servers. There are about 500 rows and 10-20 Updates per minute on the table. The files stored in the bytea are anything from 10kB to 10MB. My PostgreSQL version is 8.0.13 on Gentoo Linux (x86) with PostGIS 1.2.0. For vacuum I use the pg_autovacuum daemon. It decided to vacuum my cache table about every 3 hours, the vacuum process takes 20-30 minutes (oops!) every time. Now my big big problem is that the database gets really really slow during these 20 minutes and after the vacuum process is running for a short time, many transactions show state "UPDATE waiting" in the process list. In my Java application server I sometimes get tons of deadlock Exceptions (waiting on ShareLock blahblah). The web frontend gets nearly unusable, logging in takes more than 60 seconds, etc. etc. Under normal circumstances my application is really fast, vacuuming other tables is no problem, only the bytea table is really awkward I hope some of you performance cracks can help me... this is my table definition: Table »public.binary_cache« Column | Type | Attributes ----------+-----------------------------+----------- cache_id | bigint | not null date | timestamp without time zone | data | bytea | Indexe: »binary_cache_pkey« PRIMARY KEY, btree (cache_id) Thanks in advance for any hints! -- Bastian Voigt Neumünstersche Straße 4 20251 Hamburg telefon +49 - 40 - 67957171 mobil +49 - 179 - 4826359