Re: Toast space grows

From: "Pavel Rotek" <pavel(dot)rotek(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Toast space grows
Date: 2008-03-07 12:59:46
Message-ID: 3556c08c0803070459i8598423t64e0704e48af533@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

2008/3/7, Bill Moran <wmoran(at)collaborativefusion(dot)com>:
>
> In response to "Pavel Rotek" <pavel(dot)rotek(at)gmail(dot)com>:
>
> >
> > There are inserts and few updates (but what do you mean with update??
>
>
> He means adding or changing data in the table.

I understand, but i don't have deep understanding of mechanism, that affects
toast space. I don't know if toast space is affected only with commited
transactions or also with uncommitted transactions. This is the reason why i
asked.

> committed update??, because there are many updates of the log attribute in
> > trasaction, we do periodical flush during transaction)
>
>
> Are you saying you have long-running transactions? How long does a
> single transaction take?
>
> Transactions prevent vacuum from being able to clean up. Long running
> transactions tend to render vacuum ineffective.

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.

>, sum takes
> > approximately 1,2G, and i mean vacuum full (but there is no lock on the
> > table when running vacuum full). I haven't try plain vacuum.
>
>
> Don't do vacuum full on this table. Do frequent vacuums. The table will
> bloat some, but not 10x the required size, once you find a reasonable
> frequency for vacuums. You might find it practical to manually vacuum
> this table from your application after insert and update operations.

I perform autovacuum daily.

>
> > 2008/3/7, Richard Huxton <dev(at)archonet(dot)com>:
> > >
> > > Pavel Rotek wrote:
> > > > Hello,
> > > >
> > > > i have problem with following table...
> > > >
> > > > create table dataaction (
> > > > id INT4 not null,
> > > > log text,
> > > > primary key (id)
> > > > );
> > > >
> > > > It is the table for storing results of long running jobs. The log
> > > attribute
> > > > takes approximately 5MB for one row (there is about 300 rows). My
> > > problem
> > > > is, that table dataaction takes after restoring about 1,5G, but in
> few
> > > days
> > > > grows to 79G(Toast space)...
> > >
> > >
> > > 1. What is happening with this table - just inserts, lots of updates?
> > >
> > > 2. What does SELECT sum(length(log)) FROM dataaction; show?
> > >
> > >
> > > > Vacuum on the table doesn't finish.
> > >
> > >
> > > A plain vacuum doesn't finish, or vacuum full doesn't finish?
> > >
> > >
> > > --
> > > Richard Huxton
> > > Archonet Ltd
> > >
> >
>
>
>
> --
> Bill Moran
> Collaborative Fusion Inc.
> http://people.collaborativefusion.com/~wmoran/
>
> wmoran(at)collaborativefusion(dot)com
> Phone: 412-422-3463x4023
>
> ****************************************************************
> IMPORTANT: This message contains confidential information and is
> intended only for the individual named. If the reader of this
> message is not an intended recipient (or the individual
> responsible for the delivery of this message to an intended
> recipient), please be advised that any re-use, dissemination,
> distribution or copying of this message is prohibited. Please
> notify the sender immediately by e-mail if you have received
> this e-mail by mistake and delete this e-mail from your system.
> E-mail transmission cannot be guaranteed to be secure or
> error-free as information could be intercepted, corrupted, lost,
> destroyed, arrive late or incomplete, or contain viruses. The
> sender therefore does not accept liability for any errors or
> omissions in the contents of this message, which arise as a
> result of e-mail transmission.
> ****************************************************************
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Alvaro Herrera 2008-03-07 13:19:25 Re: Toast space grows
Previous Message RaviRam Kolipaka 2008-03-07 12:59:06 Re: postgresql Explain command output