Re: Additional DTrace Probes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, Robert Lor <Robert(dot)Lor(at)Sun(dot)COM>, pgsql-hackers list <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Additional DTrace Probes
Date: 2009-04-02 21:21:25
Message-ID: 29042.1238707285@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> After talking to Tom, I have reverted this patch. It does not contain
> documentation, and are not properly placed, and was submitted in
> February. I was hoping it would be an easy addition but obviously not
> so please resubmit for 8.5. Sorry.

Aside from the lack of documentation, I thought the executor probes
were suffering from a lack of design clarity. If the intention was
to probe every executor node, why did the patch miss a lot of node
types? Why not solve it once and for all with a single probe in
ExecProcNode()? Perhaps the idea was to make it less painful to
trace the usage of particular node types, which is sensible, but then
why did you put a probe in execScan rather than the individual calling
scan-type nodes? Surely the ability to easily count seqscan vs
indexscan would have to rank mighty high in any evaluation of whether
it's easy to count particular node types.

I was also pretty unhappy with passing the node pointers to the probes.
What are probe routines realistically going to do with those? We feel
free to whack the contents of executor node types around often, even in
stable branches sometimes. I do *not* want to encourage probe authors
to write code that depends on the contents of those struct types.
(Heck, we probably shouldn't encourage them to assume the values of enum
NodeTag even, so having a single probe in ExecProcNode is likely not
a good solution. I will certainly not hold still for any future
suggestions that we should avoid renumbering NodeTag or changing struct
types because someone has written a probe that depends on it.)

So this needs much more thought about where executor probes should go
and what their arguments should be.

I'm also a bit worried about the speed issue. The existing DTrace
probes are tracking relatively expensive operations like I/O calls.
We *know* that a kernel call per ExecProcNode iteration is highly
expensive; see experience with EXPLAIN ANALYZE overhead on any platform
that hasn't got a fast path for gettimeofday. I don't think that
dropping probes into the executor loop is something we should do
without careful analysis of what they're good for and whether anyone
would really use them.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2009-04-02 21:27:01 Re: [pgsql-www] Mentors needed urgently for SoC & PostgreSQL Student Internships
Previous Message Pavel Stehule 2009-04-02 21:02:58 Re: fix - function call with variadic parameter for type "any"