pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stefano Dal Pra <s.dalpra@gmail.com>
To: Stéphane Schildknecht <stephane.schildknecht@postgresqlfr.org>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Vacuum goes worse
Date: Wed, 17 Oct 2007 16:35:16 +0200
Message-ID: <290a5abc0710170735w601b8336v2645e90a54be0e10@mail.gmail.com> (raw)
In-Reply-To: <4715F2ED.20604@postgresqlfr.org>
References: <47147AD8.9010704@postgresqlfr.org>
	<15640.1192544768@sss.pgh.pa.us>
	<4714D817.30701@postgresqlfr.org>
	<dcc563d10710160843q3b67e618ua302eb9f1d09b650@mail.gmail.com>
	<18249.1192550596@sss.pgh.pa.us>
	<4715F2ED.20604@postgresqlfr.org>

Your first post says vacuum goes worse (slower).
I see that you do not issue the -f option (FULL VACUUM).

I had a similar situation with a server (with frequent update)
performing nightly vacuumdb. After a few many days it went
slower and slower.

The first solution was to add the -f switch.
Note that it leads to table lock (see docs :-)

the FULL option completely rewrite the table on disk making it much
more compact
(i think of it similar to a "defrag" on windows). I had a dramatic
speed improvement
after the first vacuum full.

latest solution (psql 8.0.1) was a perl script which selectively
chooses tables to
full vacuum basing on results from this select:

SELECT a.relname, a.relpages FROM pg_class a ,pg_stat_user_tables b
WHERE a.relname = b.relname order by relpages desc;

this was to see how much a table's size grows through time.

With psql 8.2.x we adopted pg_autovacuum which seems to perform good,
even thought
i do not clearly understand whether it occasionally performs a full
vacuum (i think he does'nt).

Stefano



On 10/17/07, Stéphane Schildknecht
<stephane.schildknecht@postgresqlfr.org> wrote:
> Tom Lane a écrit :
> > "Scott Marlowe" <scott.marlowe@gmail.com> writes:
> >
> >> On 10/16/07, St=E9phane Schildknecht
> >> <stephane.schildknecht@postgresqlfr.org> wrote:
> >>
> >>> That's also why I am so disappointed vacuum doesn't give me these 4
> >>> hints lines.
> >>>
> >
> >
> >> What kind of error, or output, does it give you at the end?  Any hint
> >> as to why they're missing?
> >>
> >
> > If you're talking about the FSM statistics display, that only gets
> > printed by a database-wide VACUUM (one that doesn't name a specific
> > table).
> >
>
> Yes, I am. The command line is (in a shell script whom ouput is
> redirected in a global file) :
>
> vacuumdb -d $DBNAME -p $DBPORT -U $DBUSR -z -v
>
>
> That does not explain why we don't get FSM statitics display. The output
> ends with:
> INFO:  vacuuming "public.sometable"
> INFO:  "sometable": removed 62 row versions in 3 pages
> DETAIL:  CPU 0.00s/0.00u sec elapsed 0.00 sec.
> INFO:  "sometable": found 62 removable, 5 nonremovable row versions in 5
> pages
> DETAIL:  0 dead row versions cannot be removed yet.
> There were 534 unused item pointers.
> 0 pages are entirely empty.
> CPU 0.00s/0.00u sec elapsed 0.00 sec.
> INFO:  analyzing "public.sometable"
> INFO:  "sometable": scanned 5 of 5 pages, containing 5 live rows and 0
> dead rows; 5 rows in sample, 5 estimated total rows
> VACUUM
>
> Best regards,
>
> Stéphane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
>



view thread (20+ messages)  latest in thread

Message-ID: <290a5abc0710170735w601b8336v2645e90a54be0e10@mail.gmail.com>
Permalink:  ../290a5abc0710170735w601b8336v2645e90a54be0e10@mail.gmail.com/
Also on:    postgresql.org/message-id/290a5abc0710170735w601b8336v2645e90a54be0e10@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: s.dalpra@gmail.com, stephane.schildknecht@postgresqlfr.org
  Subject: Re: Vacuum goes worse
  In-Reply-To: <290a5abc0710170735w601b8336v2645e90a54be0e10@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox