From: Tom Lane <tgl@sss.pgh.pa.us>
To: Esger Abbink <pgadmin@bumblebeast.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: problem concerning vacuum/statistics & query performance
Date: Fri, 18 Jan 2002 11:09:37 -0500
Message-ID: <6813.1011370177@sss.pgh.pa.us> (raw)
In-Reply-To: <200201181535.QAA24815@fikkie.vesc.nl>
References: <200201181535.QAA24815@fikkie.vesc.nl>
"Esger Abbink" <pgadmin@bumblebeast.com> writes:
> if i manually VACUUM ANALYZE the db when it is pretty loaded (~300k
> rows) the planner starts using a different plan which runs acceptable
> performance wise. however after the daily cleanup it reverts back to
> the old (bad) plan.
> so it seems the nightly VACUUM does some analyzing as well?
Plain VACUUM (no ANALYZE) won't touch pg_statistic, but it does update
the pages and tuples estimates in pg_class.
> in which case the planner is using totally off-base statistics for
> most of the day, which in itself isnt bad but i'd rather have it use
> large table stats on small tables than vice versa.
You could do this in your nightly script:
-- delete lotsa stuff from mytable;
vacuum mytable;
update pg_class set reltuples = M, relpages = N where relname = 'mytable';
where M and N correspond to the peak values instead of the minima.
Kinda grotty but it'll get the job done.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgadmin@bumblebeast.com
Subject: Re: problem concerning vacuum/statistics & query performance
In-Reply-To: <6813.1011370177@sss.pgh.pa.us>
References: <200201181535.QAA24815@fikkie.vesc.nl> <6813.1011370177@sss.pgh.pa.us>
* 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