Re: About vacuuming

From: "Jason Priebe" <priebe(at)mi-corporation(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: About vacuuming
Date: 2002-03-01 14:24:04
Message-ID: 002701c1c12c$bda762f0$02a8a8c0@priebe
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)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(dot)peltonen(at)fivetec(dot)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?).
> >

In response to

Browse pgsql-general by date

  From Date Subject
Next Message news.apexsc.com 2002-03-01 15:17:39 VACUUM query
Previous Message Johnson, Shaunn 2002-03-01 14:00:23 check sql progress