Re: Huge number of disk writes after migration to 8.1

From: Chris Campbell <chris(at)bignerdranch(dot)com>
To: pgsql-bugs(at)postgreSQL(dot)org
Subject: Re: Huge number of disk writes after migration to 8.1
Date: 2006-01-19 13:25:11
Message-ID: 7183C23F-98E3-4C93-8B5B-49EDA82A5F17@bignerdranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2006-01-19 13:51:18 Re: Huge number of disk writes after migration to 8.1
Previous Message marc mamin 2006-01-19 12:57:56 BUG #2185: function compilation error with "Create [TEMP] table?