Vacuum and Vacuum analyze - Mailing list pgsql-novice

From Chris Boget
Subject Vacuum and Vacuum analyze
Date
Msg-id 00ce01c33f0e$6d68c2a0$8c01a8c0@ENTROPY
Whole thread Raw
Responses Re: Vacuum and Vacuum analyze
List pgsql-novice
I'm starting a new thread, apart from the one I started
earlier, just on this topic.

Should you run either (or both) of these every time you've
added data to the database?  After you've added indexes
or keys?  As I mention in my other email, I ran a query
immediately after I added the data and the response time
was dismal to say the least.  After seeing that, I tried add-
ing a few new indexes in hopes of speeding up the  query
but that didn't help matters, either.  The response time was
just as bad (although, the new indexes did shave off a
millisecond or two).

But then, on the suggestion of two fellow list members, I
ran 'vacuum analyze' from the command line (even though
I had done that already, with no apparent effect, through the
pgAdminII interface but that's another topic) then executed
the query again.  I was very happy to see that the rows were
returning in milliseconds as opposed to the (many) seconds
they were being returned previously.

So that begs the question (from a newbie), when should these
commands, 'vacuum' and 'vacuum analyze' be run and how
often?

thnx,
Christoph


pgsql-novice by date:

Previous
From: "Chris Boget"
Date:
Subject: Re: Noobie: Problems with a query
Next
From: Bruno Wolff III
Date:
Subject: Re: Noobie: Problems with a query