[imp] Postgres vacuuming
The Hermit Hacker
scrappy@hub.org
Thu, 21 Dec 2000 00:26:06 -0400 (AST)
On Wed, 20 Dec 2000 jlewis@lewis.org wrote:
> On Wed, 20 Dec 2000, Rich Lafferty wrote:
>
> > Realized that we hadn't run VACUUM or VACUUM ANALYZE, *ever*.
> >
> > Ran VACUUM, which took ten minutes (!).
> >
> > Now, "SELECT count(*) FROM active_sessions" takes under a second, and
> > IMP isn't running slowly.
>
> What is VACUUM? Is it pg specific?
I *believe* that VACUUM is a standard SQL command, actually ... I haven't
used Oracle in years, but thought they had it too ...
VACUUM in Pg has two modes ... simple VACUUM, which is soon to be
reasonably obsolete(1), cleans out all the old cruft(2) and truncates the
tables ... VACUUM ANALYZE does the above, but also generates statistics
that are used to determine what direction the planner and optimizer take
in order to get you the answer (namely, how it uses indices, but it also
determines ordering of retrieving the data in multi table joins) ...
1 - v7.2 has a storage manager re-write schedualed that will get rid of
the need to deal with (2) ...
2 - current versions of PgSQL's storage manager doesn't re-use space freed
up on an UPDATE or a DELETE ... whenever you UPDATE a record, for
instance, it INSERTs a new one and then marks the old one as DELETEd,
so a table will continue to grow, but not reuse space available by the
DELETEd records ...
> mysql> SELECT count(*) FROM active_sessions;
> +----------+
> | count(*) |
> +----------+
> | 3802 |
> +----------+
> 1 row in set (0.03 sec)
>
> I really doubt we have 3802 users actively using IMP right now. Isn't
> there a garbage collection routine that's supposed to be killing old
> sessions?
>
>
> ----------------------------------------------------------------------
> Jon Lewis *jlewis@lewis.org*| I route
> System Administrator | therefore you are
> Atlantic Net |
> _________ http://www.lewis.org/~jlewis/pgp for PGP public key_________
>
>
> --
> IMP mailing list: http://horde.org/imp/
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: imp-unsubscribe@lists.horde.org
>
>
Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org