Re: pg_stat_statements in core - Mailing list pgsql-hackers

From ITAGAKI Takahiro
Subject Re: pg_stat_statements in core
Date
Msg-id 20081023100921.B70F.52131E4D@oss.ntt.co.jp
Whole thread Raw
In response to Re: pg_stat_statements in core  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses contrib/pg_stat_statements v2
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> It needs to be a contrib or pgfoundry package for awhile,
> to shake out feature issues in a context where users will understand
> the API is subject to change.

Agreed. That is what I want to do at first.

> It seems to me that all you're really missing is a shutdown hook
> someplace, which would be a reasonable core addition.

A shutdown hook is probably not needed because I can use proc_exit()
or shmem_exit() for the purpose. 

- On Windows, shared_preload_libraries will be loaded not only by postmaster and backends but also by auxiliary
processes.(I think it is also required by rmgr hooks.)
 

- Add a function BgWriterIAm() to export a variable am_bg_writer. It is used for dumping stats data on shutdown as
following:  on_proc_exit( dump_stats_if_BgWriterIAm );
 

- It might be cleaner to add a callback function on_startup(). Registered functions are called by startup process after
REDO.It is used for loading stats data, but is not always necessary because the first user of the module can load the
data.

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




pgsql-hackers by date:

Previous
From: "Robert Haas"
Date:
Subject: Re: psql Feature request \set query
Next
From: ITAGAKI Takahiro
Date:
Subject: Re: double-buffering page writes