Re: Auto-explain patch - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: Auto-explain patch
Date
Msg-id BAY102-W270D92DBFAD83E0B24919FF25D0@phx.gbl
Whole thread Raw
In response to Re: Auto-explain patch  (ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Responses Re: Auto-explain patch  (ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
List pgsql-hackers
> * auto_explain.tgz
> A contrib module version of auto-explain.
> An arguable part is initializing instruments in ExecutorRun_hook.
> The initialization should be done in ExecutorStart normally, but
> it is too late in the hook. Is it safe? or are there any better idea?
> README is a plain-text for now, and I'll rewrite it in sgml if needed.
>

How about adding a new hook to control instrumentation of queries in
ExecutorStart? Something like:

typedef bool (*ExecutorDoInstrument_hook_type) (QueryDesc *queryDesc, int eflags);

extern PGDLLIMPORT ExecutorDoInstrument_hook_type ExecutorDoInstrument_hook;

I think that would allow your module code to be simplified,
and it would allow other future extensions to hook in and
enable instrumentation before queries are run.

Regards, Dean.

_________________________________________________________________
Win a voice over part with Kung Fu Panda & Live Search   and   100’s of Kung Fu Panda prizes to win with Live Search
http://clk.atdmt.com/UKM/go/107571439/direct/01/

pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Attaching error cursor position to invalid constant values
Next
From: Tom Lane
Date:
Subject: Cause of occasional buildfarm failures in sequence test