pg_stat_statements in core

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: pg_stat_statements in core
Date: 2008-10-21 04:56:01
Message-ID: 20081021134140.811D.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> Now I'm working on storing statistics into disks on server
> shutdown. If it is impossible unless the module is in core,
> I would change my policy...

I reconsidered this part and found that pg_stat_statements needs to be
in core to write stats in file on server shutdown because:

1. shared_preload_libraries are only loaded in postmaster and backends.
2. Postmaster should write stats file because it is the only process
that knows when to shutdown.
3. Postmaster cannot attach shared memory which contains statement stats
because it cannot acquire LWLocks at all.

My next plan is put pg_stat_statements into core and treat it just like as
freespacemap in 8.3 or before. Stats file is read by bootstrap process and
written down by bgwriter process. All of the codes in pg_stat_statements
will be merged into pgstat.c and some of interface functions will be called
from ExecutorRun instead of using ExecutorRun_hook.

If no objections, I'll go ahead in the direction.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeffrey Baker 2008-10-21 05:25:16 Re: Multi CPU Queries - Feedback and/or suggestions wanted!
Previous Message Theodore Wong 2008-10-21 04:41:50 TSEARCH2 Thesaurus limitations