pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Boes <jboes@nexcerpt.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: Still confused about VACUUM vs. VACUUM FULL
Date: 12 Jun 2003 13:25:13 -0400
Message-ID: <1055438712.27084.44.camel@takin.private.nexcerpt.com> (raw)
In-Reply-To: <18292.1055438167@sss.pgh.pa.us>
References: <1055434723.27087.23.camel@takin.private.nexcerpt.com>
	<16631.1055436156@sss.pgh.pa.us>
	<1055436783.27087.38.camel@takin.private.nexcerpt.com>
	<18292.1055438167@sss.pgh.pa.us>

On Thu, 2003-06-12 at 13:16, Tom Lane wrote:

> > We're also ANALYZE-ing the largest 12-18 tables on a cycle: every twenty
> > minutes, a daemon wakes up and ANALYZEs until they're all done or two
> > minutes has elapsed, whichever comes first.
> 
> That sounds a tad excessive; are the statistics really changing that
> fast?


Well, I have some convincing evidence on this. One table at the center
of some of our biggest, hairiest queries uses an index on a timestamp.
Generally, the queries run looking back about 24 hours. We are inserting
40,000 rows a day (and deleting the same number, but the deletes happen
all at once, and the inserts happen during nearly every part of the
clock).

I've done

  explain select * from foo where the_time < <some-timestamp>;

and found that I could slice it down to a one-minute interval or so:
before 11:42 AM, and the optimizer uses a sequential scan; after, and it
uses the index.

And of course it stays at that point, even if another 10,000 rows get
inserted with current timestamps, until it's ANALYZEd again. So two or
three ANALYZEs per hour is not excessive, if it will keep the index
usable under the "right" circumstances.

-- 
Jeff Boes                                      vox 269.226.9550 ext 24
Database Engineer                                     fax 269.349.9076
Nexcerpt, Inc.                                 http://www.nexcerpt.com
           ...Nexcerpt... Extend your Expertise




view thread (6+ messages)  latest in thread

Message-ID: <1055438712.27084.44.camel@takin.private.nexcerpt.com>
Permalink:  ../1055438712.27084.44.camel@takin.private.nexcerpt.com/
Also on:    postgresql.org/message-id/1055438712.27084.44.camel@takin.private.nexcerpt.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 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: jboes@nexcerpt.com, tgl@sss.pgh.pa.us
  Subject: Re: Still confused about VACUUM vs. VACUUM FULL
  In-Reply-To: <1055438712.27084.44.camel@takin.private.nexcerpt.com>
  References: <1055434723.27087.23.camel@takin.private.nexcerpt.com> <16631.1055436156@sss.pgh.pa.us> <1055436783.27087.38.camel@takin.private.nexcerpt.com> <18292.1055438167@sss.pgh.pa.us> <1055438712.27084.44.camel@takin.private.nexcerpt.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