Re: On-demand running query plans using auto_explain and signals

From: "Shulgin, Oleksandr" <oleksandr(dot)shulgin(at)zalando(dot)de>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: On-demand running query plans using auto_explain and signals
Date: 2015-09-29 17:52:46
Message-ID: CACACo5ReQKEzKyGCsEMYr9v23qsP=tStaFsstTK8G7_vXsWbxA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 29, 2015 at 7:01 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:

> On 25 September 2015 at 12:13, Shulgin, Oleksandr <
> oleksandr(dot)shulgin(at)zalando(dot)de> wrote:
>
>
>> I now believe that use of ProcessInterrupts() in the recently proposed
>> design as well as manipulation of proc latch due to use of shared memory
>> queue are major blockers.
>>
>> In order to simplify things up, I've taken a step back and looked again
>> at the auto_explain contrib module. I now propose the most simple thing
>> possible in my opinion: a new GUC option for auto_explain. It will make
>> every backend, in which the module is loaded via *_preload_libraries
>> mechanism or using CREATE EXTENSION/LOAD commands, to actively publish the
>> plans of queries in dynamic shared memory as long as
>> auto_explain.publish_plans is turned on.
>>
>> The greatest part for me, is that this approach doesn't require handling
>> of signals and is isolated in an external module, so it can be readily used
>> with the current server versions, no need to wait for >= 9.6.
>>
>
> This is a major change of direction, so the thread title no longer applies
> at all.
>
> The requirement is to be able to see the output of EXPLAIN ANALYZE for a
> running process. Ideally, we would dump the diagnostic output for any
> process that runs longer than a specific timeout, so we can decide whether
> to kill it, or just save that for later diagnostics.
>
> I'm interested in helping the original goal happen. Dumping an EXPLAIN,
> without ANALYZE info, is not at all interesting since it has no value for
> immediate action or post-facto diagnosis, sorry to say - making it happen
> for every backend just makes it even less useful.
>

This is not a change of the direction, but rather of the approach. Hitting
a process with a signal and hoping it will produce a meaningful response in
all circumstances without disrupting its current task was way too naive.
I'd really want to make this work with ANALYZE, just not as the first
step. I believe this approach can be extended to include instrumentation
support (obviously we will not be able to contain this in the auto_explain
module).

--
Alex

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2015-09-29 18:06:19 Re: track_commit_timestamp and COMMIT PREPARED
Previous Message Robert Haas 2015-09-29 17:49:38 Re: Foreign join pushdown vs EvalPlanQual