Re: [Solved] Postgres performance problem - Mailing list pgsql-performance

From Richard Huxton
Subject Re: [Solved] Postgres performance problem
Date
Msg-id 46D70758.6010507@archonet.com
Whole thread Raw
In response to Re: [Solved] Postgres performance problem  (Decibel! <decibel@decibel.org>)
List pgsql-performance
Decibel! wrote:
> On Thu, Aug 30, 2007 at 11:50:04AM +0200, Ruben Rubio wrote:
>> As you may know, I do a vacuum full and a reindex database each day. I
>> have logs that confirm that its done and I can check that everything was
>>  fine.
>>
>> So, this morning, I stopped the website, I stopped database, started it
>> again. (I was around 200  days without restarting), then I vacuum
>> database and reindex it (Same command as everyday) . Restart again, and
>> run again the website.
>>
>> Now seems its working fine. But I really does not know where is the
>> problem. Seems vacuum its not working fine?  Maybe database should need
>> a restart? I really don't know.
>
> No, it sounds to me like you just weren't vacuuming aggressively enough
> to keep up with demand.

Actually , I think it sounds like a stray long-lived transaction.

Ruben - vacuum can't recover rows if another transaction might be able
to see them. So, if you have a connection that issues BEGIN and sits
there for 200 days you can end up with a lot of bloat in your database.

Now, there's no way to prove that since you've restarted the
database-server, but keep an eye on it.

--
   Richard Huxton
   Archonet Ltd

pgsql-performance by date:

Previous
From: Mark Lewis
Date:
Subject: Re: [Solved] Postgres performance problem
Next
From: Pallav Kalva
Date:
Subject: 8.2 Autovacuum BUG ?