pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org, Andres Freund <andres@anarazel.de>
Subject: Re: jit and explain nontext
Date: Sat, 17 Oct 2020 14:21:34 -0500
Message-ID: <20201017192134.GD9241@telsasoft.com> (raw)
In-Reply-To: <CAApHDvozf41o7bUyLL42LWwAjqjRuDToeWy-S5jwR4BieM7SYA@mail.gmail.com>
References: <20201014193859.GS9241@telsasoft.com>
	<CAApHDvpPt=iN=f5gHQSCA073mp5KO46gsEZFgTWc4xbzKshb9g@mail.gmail.com>
	<3643530.1602724513@sss.pgh.pa.us>
	<CAApHDvqK2HAm-BWxgo7=7GG5xERuECwgny+Sxh3iLfXmhR_yBQ@mail.gmail.com>
	<20201015014326.GU9241@telsasoft.com>
	<CAApHDvozf41o7bUyLL42LWwAjqjRuDToeWy-S5jwR4BieM7SYA@mail.gmail.com>

On Thu, Oct 15, 2020 at 02:51:38PM +1300, David Rowley wrote:
> On Thu, 15 Oct 2020 at 14:43, Justin Pryzby <pryzby@telsasoft.com> wrote:
> > On Thu, Oct 15, 2020 at 02:23:01PM +1300, David Rowley wrote:
> > > On Thu, 15 Oct 2020 at 14:15, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > > > Hmm, I dunno if my opinion counts as "wisdom", but what I was arguing for
> > > > there was that we should print stuff if it's potentially invoked by a
> > > > run-time decision, but not if it was excluded at plan time.  I'm not
> > > > totally clear on whether jitting decisions are fixed by the plan tree
> > > > (including its cost values) or if the executor can make different
> > > > decisions in different executions of the identical plan tree.
> > > > If the latter, then I agree with Justin that this is a bug.
> > >
> > > As far as I know, the only exception where the executor overwrites the
> > > planner's decision is in nodeValuesscan.c where it turns jit off
> > > because each VALUES will get evaluated just once, which would be a
> > > waste of effort to JIT.
> > >
> > > Apart from that the choice is baked in by the planner and set in
> > > PlannedStmt.jitfFlags.
> >
> > What about the GUCs themselves ?
> >
> > They can change after planning, which means a given execution of a plan might
> > or might not use jit.
> 
> That's a pretty good point.

Added at: https://commitfest.postgresql.org/30/2766/

inline patch 1: src/backend/commands/explain.c (+2/-1 lines) download inline-1.patchdiff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 41317f1837..7345971507 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -839,7 +839,8 @@ ExplainPrintJIT(ExplainState *es, int jit_flags, JitInstrumentation *ji) instr_time total_time; /* don't print information if no JITing happened */ - if (!ji || ji->created_functions == 0) + if (!ji || (ji->created_functions == 0 && + es->format == EXPLAIN_FORMAT_TEXT)) return; /* calculate total time */ -- 2.17.0
Patches and attachments: download all (2 files, .tar.gz)
v1-0001-explain-show-JIT-details-in-non-text-format-even-.patch (text/x-diff, 864B) download From 237f4d5d0739583683fd7a4d67a6e3d9120aba04 Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryzbyj@telsasoft.com> Date: Sat, 17 Oct 2020 14:10:11 -0500 Subject: [PATCH v1] explain: show JIT details in non-text format, even if zero --- src/backend/commands/explain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 41317f1837..7345971507 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -839,7 +839,8 @@ ExplainPrintJIT(ExplainState *es, int jit_flags, JitInstrumentation *ji) instr_time total_time; /* don't print information if no JITing happened */ - if (!ji || ji->created_functions == 0) + if (!ji || (ji->created_functions == 0 && + es->format == EXPLAIN_FORMAT_TEXT)) return; /* calculate total time */ -- 2.17.0

view thread (16+ messages)  latest in thread

Message-ID: <20201017192134.GD9241@telsasoft.com>
Permalink:  ../20201017192134.GD9241@telsasoft.com/
Also on:    postgresql.org/message-id/20201017192134.GD9241@telsasoft.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: pryzby@telsasoft.com, dgrowleyml@gmail.com, tgl@sss.pgh.pa.us, andres@anarazel.de
  Subject: Re: jit and explain nontext
  In-Reply-To: <20201017192134.GD9241@telsasoft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox