Re: About vacuuming - Mailing list pgsql-general

From Jason Priebe
Subject Re: About vacuuming
Date
Msg-id 002701c1c12c$bda762f0$02a8a8c0@priebe
Whole thread Raw
In response to Re: About vacuuming  ("Tim Barnard" <tbarnard@povn.com>)
List pgsql-general
Just to further this a bit -- running or not running VACUUM ANALYZE can
have huge
performance implications.  Some queries were taking extremely long times
to execute on our database.  Running a VACUUM ANALYZE (which had not
ever been done on this database, despite having inserted hundreds of
thousands of records) led to at least an order of magnitude improvement
in the performance of the query.  Basically, the optimizer was working
with no good information before the VACUUM ANALYZE; now it's got all
kinds of statistics to improve its optimization.

This particular query was joining about 5 tables, so there were lots
of opportunities for optimization.

Jason Priebe
Mi-Co
http://www.mi-corporation.com/


> -----Original Message-----
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Tim Barnard
>
> Vacuum analyze updates the statistics that the db uses to
> determine various
> query plans, so I'd always run it as vacuum analyze, rather than just
> vacuum.
>
> ----- Original Message -----
> From: "Peter Peltonen" <peter.peltonen@fivetec.com>
>
> > Is vacuum --analyze for just providing information or does
> it somehow
> > store it's info for postgresql's use (in other words:
> should I run it too,
> > and if so, should I do it before or after the real vacuum?).
> >


pgsql-general by date:

Previous
From: a_asvin@mailcity.com (Asvin Ananthanarayan)
Date:
Subject: PostgreSQl or BerkeleyDB ??
Next
From: Andrew Sullivan
Date:
Subject: Re: terminal with horizontal scrollbar