Re: VACUUM and ANALYZE With Empty Tables

From: "gnari" <gnari(at)simnet(dot)is>
To: "Mark Dexter" <MDEXTER(at)dexterchaney(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: VACUUM and ANALYZE With Empty Tables
Date: 2004-11-24 22:29:14
Message-ID: 002301c4d275$07277710$0100000a@wp2000
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

From: "Mark Dexter" <MDEXTER(at)dexterchaney(dot)com>

> Thanks very much for the information. It would appear that our best
option might be to vacuum analyze these tables in our
> application at a point in time when they contain rows instead of doing it
at night. Needlesst to say, it would nice to have > an option to analyze
with a target number of rows instead of the number presently in the table.

> I suppose another option would be to keep a small number of rows
permanently in these tables. In my testing, 100 rows (94 to > be exact) did
the trick. Is this number going to vary from table to table?

or, you could add this procedure to your nightly vacuum job:
(after regular vacuum analyzes)
insert a representative dummy row set into the empty table
analyze the table
remove the rows again

this way the dummy rows wont interfere with your regular operations.
if the table is not always empty at vacuum time, you need to be
able to differentiate the dummy rows from the regular ones to be able
to remove only the dummy ones, of course.

gnari

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mark Childerson 2004-11-24 23:16:00 Replication & BLOBs
Previous Message Andrew - Supernews 2004-11-24 20:57:26 Re: Upcoming Changes to News Server ...