Re: Query running slow but was running fine before - Mailing list pgsql-general

From Dennis Brakhane
Subject Re: Query running slow but was running fine before
Date
Msg-id 226a19190807080332h212e3876udf19e92aa5d006cb@mail.gmail.com
Whole thread Raw
In response to Query running slow but was running fine before  (Keaton Adams <kadams@mxlogic.com>)
Responses Re: Query running slow but was running fine before
List pgsql-general
On Tue, Jul 8, 2008 at 12:06 AM, Keaton Adams <kadams@mxlogic.com> wrote:
> An analyze is run on the tables every day (even several times a day because
> they are updated very frequently) and a vacuum analyze is run on the
> weekends.  I also tried to run an analyze specifically on the customer_id
> column and then the product_id column but that didn't help.

I'm no expert, so if I'm talking nonsense here, someone please correct me.

From what I read on this list I believe you need to run VACUUM
frequently if there are many updates, at least daily,
but it could also be needed every n minutes in extreme cases, an
ANALYSE won't cut it.

(UPDATE leaves dead rows in the database, which must be filtered out
by count(*), vacuum gets rid of them)

Try a VACUUM FULL (at a time when there isn't much load on the
server), if this solves your problem, you need to decrease your VACUUM
interval.

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: please explain vacuum with WAL
Next
From: "Albe Laurenz"
Date:
Subject: Re: please explain vacuum with WAL