Re: Huge number of disk writes after migration to 8.1 - Mailing list pgsql-bugs

From Chris Campbell
Subject Re: Huge number of disk writes after migration to 8.1
Date
Msg-id 7183C23F-98E3-4C93-8B5B-49EDA82A5F17@bignerdranch.com
Whole thread Raw
In response to Re: Huge number of disk writes after migration to 8.1  ("Magnus Hagander" <mha@sollentuna.net>)
Responses Re: Huge number of disk writes after migration to 8.1
List pgsql-bugs
On Jan 19, 2006, at 06:51, Magnus Hagander wrote:

> In most cases you're going to see extremely few reads compared to
> writes
> on pg_stats, right? So why not have the backends connect to the stats
> process (or perhaps use UDP, or use the pipe, or whatever) and
> fetch the
> data when needed. So when nobody fetches any data, there is no
> overhead
> (except for the stats process adding up values, of course).

Do the stats need to persist across postmaster restarts (or crashes)?
If so, then they need to be written to disk at some point, so we
can't get rid of the stats file and the frequent writes to it. Or
maybe there could be a GUC setting for persisting stats -- if it's
enabled, it works as implemented today (flushed to disk every 500ms).
If it's disabled, the stats are only stored in-memory and never
written to a file; the postmaster could automatically do an "ANALYZE"
on startup to fill the in-memory stats.

We could move the stat file writes to happen only at a checkpoint.
Backends would get up-to-date info directly from the stats process as
you described, but it would always be persisted at a checkpoint.
Those *should* be less-frequent than every half a second. :)

- Chris

pgsql-bugs by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: Huge number of disk writes after migration to 8.1
Next
From: Alvaro Herrera
Date:
Subject: Re: Huge number of disk writes after migration to 8.1