pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: 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: Mon, 30 Nov 2020 10:59:32 -0600
Message-ID: <20201130165932.GA7242@telsasoft.com> (raw)
In-Reply-To: <20201121162600.GN24784@telsasoft.com>
References: <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>
	<20201017192134.GD9241@telsasoft.com>
	<a56f853c-e671-c4b1-7e0e-a1f0a18621e4@enterprisedb.com>
	<20201120161622.GI24784@telsasoft.com>
	<e5f51922-a6af-4ada-62fa-a18ca6d0b469@enterprisedb.com>
	<20201121162600.GN24784@telsasoft.com>

On Sat, Nov 21, 2020 at 10:26:00AM -0600, Justin Pryzby wrote:
> On Sat, Nov 21, 2020 at 08:39:11AM +0100, Peter Eisentraut wrote:
> > On 2020-11-20 17:16, Justin Pryzby wrote:
> > > It matters if it was planned with jit but executed without jit.
> > > 
> > > postgres=# DEALLOCATE p; SET jit=on; SET jit_above_cost=0; prepare p as select from generate_series(1,9); explain(format yaml) execute p; SET jit=off; explain(format yaml) execute p;
> > > 
> > > Patched shows this for both explains:
> > >     JIT:                              +
> > >       Functions: 3                    +
> > > 
> > > Unpatched shows only in the first case.
> > 
> > In this context, I don't see the point of this change.  If you set jit=off
> > explicitly, then there is no need to clutter the EXPLAIN output with a bunch
> > of zeroes about JIT.
> 
> I think the idea is that someone should be able to parse the YAML/XML/other
> output by writing something like a['JIT']['Functions'] rather than something
> like a.get('JIT',{}).get('Functions',0)
> 
> The standard seems to be that parameters that can change during execution
> should change the *values* in the non-text output, but the *keys* should not
> disappear just because (for example) parallel workers weren't available, or
> someone (else) turned off jit.  We had discussion about this earlier in the
> year:
> https://www.postgresql.org/message-id/20200728033622.GC20393@telsasoft.com
> 
> (Since it's machine-readable output, Key: 0 is Consistency and Completeness,
> not Clutter.)

If there's no interest or agreement in it, we should just close it.
I have no personal need for it, but noticed it in passing.

Attachments:

v2-0001-explain-show-JIT-details-in-non-text-format-even-.patch (text/x-diff, 941B) download From 8a580c7a90e9854d53c15b69e761161330a6bf87 Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryzbyj@telsasoft.com> Date: Sat, 17 Oct 2020 14:10:11 -0500 Subject: [PATCH v2] explain: show JIT details in non-text format, even if zero --- src/backend/commands/explain.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 43f9b01e83..89caa76801 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -838,8 +838,9 @@ 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) + /* don't print information if JITing wasn't done at planning time */ + 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: <20201130165932.GA7242@telsasoft.com>
Permalink:  ../20201130165932.GA7242@telsasoft.com/
Also on:    postgresql.org/message-id/20201130165932.GA7242@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, peter.eisentraut@enterprisedb.com, dgrowleyml@gmail.com, tgl@sss.pgh.pa.us, andres@anarazel.de
  Subject: Re: jit and explain nontext
  In-Reply-To: <20201130165932.GA7242@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