Re: Moving pgstat.stat and pgstat.tmp

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>, pgsql-general(at)postgresql(dot)org, Erik Jones <erik(at)myemma(dot)com>
Subject: Re: Moving pgstat.stat and pgstat.tmp
Date: 2007-12-05 14:39:29
Message-ID: 20951.1196865569@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> But then I thought, why do we need it to be a file
> at all? Why not use a mmap'ed memory area or something like that, and
> only write it to a file on postmaster shutdown?

Yeah, we definitely need some other technology for this. The difficulty
is in dealing with a highly variably sized chunk of data --- our
existing shmem approach won't work well, and once you get away from that
the old portability question raises its head.

There's also a synchronization issue: how can the stats collector make
updates appear atomic? mmap by itself doesn't solve that AFAIK.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ivan Sergio Borgonovo 2007-12-05 14:44:05 elegant way to fill a table with serial
Previous Message Stephane Bortzmeyer 2007-12-05 14:36:05 Re: SQL Query