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

From: "Shulgin, Oleksandr" <oleksandr(dot)shulgin(at)zalando(dot)de>
To: Andres Freund <andres(at)anarazel(dot)de>
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 11:12:35
Message-ID: CACACo5QHN+04FL9Wg+DW+F+jAN__WqajpTeXaJfq3eEvTgmmgQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 29, 2015 at 12:57 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:

> On 2015-09-25 19:13:13 +0200, Shulgin, Oleksandr wrote:
> > 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.
>
> Wait. You're proposing that every query does this unconditionally? For
> every single query? That sounds prohibitively expensive to me.
>

Only if the extension is loaded AND the option is turned on. Likely you
don't want to do this for an OLTP database, but for other types of load it
might make sense. Also, I think it should be possible to toggle this on a
per-process basis.

Finally, we can put in a cost threshold, so the plans only get published if
they have total_cost >= publish_plan_cost_threshod.

Also, do you mean expensive in terms of CPU or the dynamic shared memory?

--
Alex

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2015-09-29 11:44:56 Re: track_commit_timestamp and COMMIT PREPARED
Previous Message Etsuro Fujita 2015-09-29 11:00:28 Re: Foreign join pushdown vs EvalPlanQual