Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 769392E1DAD for ; Fri, 7 Mar 2008 09:33:24 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 52952-04 for ; Fri, 7 Mar 2008 09:33:21 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 3AD6D2E1D33 for ; Fri, 7 Mar 2008 09:33:21 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m27DXJnY011849; Fri, 7 Mar 2008 08:33:19 -0500 (EST) To: "Pavel Rotek" cc: pgsql-performance@postgresql.org Subject: Re: Toast space grows In-reply-to: <3556c08c0803070459i8598423t64e0704e48af533@mail.gmail.com> References: <3556c08c0803070035p6d8b4aa8m6318f54728f61022@mail.gmail.com> <47D10722.4080508@archonet.com> <3556c08c0803070129y6ffabf32i1c8bae445ec460e0@mail.gmail.com> <20080307065314.1248665b.wmoran@collaborativefusion.com> <3556c08c0803070459i8598423t64e0704e48af533@mail.gmail.com> Comments: In-reply-to "Pavel Rotek" message dated "Fri, 07 Mar 2008 13:59:46 +0100" Date: Fri, 07 Mar 2008 08:33:19 -0500 Message-ID: <11848.1204896799@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/159 X-Sequence-Number: 29113 "Pavel Rotek" writes: > No i do not mean long running transactions... Update of log entry (update of > row in dataaction) is performed in series of short transactions, but during > short transaction there is a lot of change log value, flush, change log > value ,flush ..... change log value, flush actions (flush means perform > flush operation via JDBC driver). I'm not sure if this flush affects toast > space... Maybe this is the reason. You mean that you build up the 5MB log entry by adding a few lines at a time? That's going to consume horrid amounts of toast space, because each time you add a few lines, an entire new toasted field value is created. If you have to do it that way, you'll need very frequent vacuums on this table (not vacuum full, as noted already) to keep the toast space from bloating too much. And make sure you've got max_fsm_pages set high enough. If you can restructure your code a bit, it might be better to accumulate log values in a short-lived table and only store the final form of a log entry into the main table. regards, tom lane