Re: [WIP] Patches to enable extraction state of query execution from external session - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [WIP] Patches to enable extraction state of query execution from external session
Date
Msg-id 20160829160247.jxstzmzcp7sfjuc2@alap3.anarazel.de
Whole thread Raw
In response to [WIP] Patches to enable extraction state of query execution from external session  (maksim <m.milyutin@postgrespro.ru>)
Responses Re: [WIP] Patches to enable extraction state of query execution from external session  (Maksim Milyutin <m.milyutin@postgrespro.ru>)
List pgsql-hackers
Hi,

On 2016-08-29 18:22:56 +0300, maksim wrote:
> Now I complete extension that provides facility to see the current state of
> query execution working on external session in form of EXPLAIN ANALYZE
> output. This extension works on 9.5 version, for 9.6 and later it doesn't
> support detailed statistics for parallel nodes yet.

Could you expand a bit on what you want this for exactly?


> 2. Patch that enables to interrupt the query executor
> (executor_hooks.patch).
> This patch enables to hang up hooks on executor function of each node
> (ExecProcNode). I define hooks before any node execution and after
> execution.
> I use this patch to add possibility of query tracing by emitted rows from
> any node. I interrupt query executor after any node delivers one or zero
> rows to upper node. And after execution of specific number trace steps I can
> get the query state of traceable backend which will be somewhat
> deterministic. I use this possibility for regression tests of my extension.

This will increase executor overhead. I think we'll need to find a way
to hide this behind the existing if (instrument) branches.


> 3. Patch that enables to output runtime explain statistics
> (runtime_explain.patch).
> This patch extends the regular explain functionality. The problem is in the
> point that regular explain call makes result output after query execution
> performing InstrEndLoop on nodes where necessary. My patch introduces
> specific flag *runtime* that indicates whether we explain running query and
> does some insertions in source code dedicated to output the statistics of
> running query.

Unless I'm missing something this doesn't really expose a user of this
functionality?


Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Oleksandr Shulgin
Date:
Subject: Re: [WIP] Patches to enable extraction state of query execution from external session
Next
From: David Steele
Date:
Subject: Re: Renaming of pg_xlog and pg_clog