Re: pg_stat_statements in core

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_stat_statements in core
Date: 2008-10-23 01:51:26
Message-ID: 20081023100921.B70F.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ITAGAKI Takahiro 2008-10-23 02:09:43 Re: double-buffering page writes
Previous Message Ran Tang 2008-10-23 01:40:33 Can anyone explain to me how the "ps_OuterTupleSlot" in PlanState is being used in implementing HashJoin?