Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kjmWa-0005pL-Bp for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Nov 2020 16:59:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kjmWZ-0005mc-AY for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Nov 2020 16:59:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kjmWZ-0005mR-3R for pgsql-hackers@lists.postgresql.org; Mon, 30 Nov 2020 16:59:39 +0000 Received: from mail-io1-xd42.google.com ([2607:f8b0:4864:20::d42]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kjmWW-0004pQ-Jx for pgsql-hackers@postgresql.org; Mon, 30 Nov 2020 16:59:38 +0000 Received: by mail-io1-xd42.google.com with SMTP id d7so3653992iok.1 for ; Mon, 30 Nov 2020 08:59:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=iNcpvkrbCesSCWjpmI0trHcMCroH/vvWCGLJifJH0ng=; b=k5wC5Mo690JJapLnOH2nTmdtVjEcGz+ai8khMBYE36Un2gHP+j9bzciKzWJVNasc+z GyeQKZyziaPhR8CelXKN5qEW+002HcPwcG9XLLfzHTIIjFnZ9PYOd2EIaWEBP7tDJbGZ IUdfYh068SzCwQ3MjN6tRuEROe5ug/YSQAvdvHBA7u4qR8rQZHCXZl+Khb6eTwYkAv+B d1bDvINfRo43ADECJskvOKIeDT6RpeJ0raEuOWIQSEP1gtbfvTpOeGVEKcacx7Xmu3Ic BN6yqbgfKslvAWTKfCllgqVyjcwuZiWnIDJeHrtkYaGf9+hrcdbJXhjLN4D9ljlQXaM6 JPqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=iNcpvkrbCesSCWjpmI0trHcMCroH/vvWCGLJifJH0ng=; b=DAPHkkRCGeUU02FRRziuu+DUAzHHDKl61ESKBYjkk6kB54IqUe8sz5rToTZHI8hydn DJk3HQR1oX8dx7cvF/eyrvZKCK61Vx4SNZsbzP7GDdNYX00N1so9/xQsievkVIfPe8wx ScyuTVZUVZh/20648VWv9HNZX2XM5aS6/XxsDKhPQUfJEqmz7o5H7f+cLLOonswYb9bK R2/TEIBDeQus5ZeVZEbxDmU6GeF9zCnafQM36bVYwoBSGSwlVKjfRgdY6NBplL/dD2nR W9kqkH0h1sXu1PtLWJFHtixPKw11KPMzsDvo8ISr915w28oVuw8KZbXr9IWQfxpgInUG QyWw== X-Gm-Message-State: AOAM530fjR24HfoKH0+8KEGtuRNR501e89DW0vxp/OaMiE9RwA/YqsaW py9OsTZsfLy85Xvv9Xleu6NPIA== X-Google-Smtp-Source: ABdhPJyQQXp6JnHJEP0tscadaXcsAoaxtFP6b7bQT7WP9DlvEODaJPzGgXVK7OWxWcw2+CW3Q9RRHA== X-Received: by 2002:a05:6602:2c48:: with SMTP id x8mr16772868iov.24.1606755574845; Mon, 30 Nov 2020 08:59:34 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id u24sm7308294ili.47.2020.11.30.08.59.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Nov 2020 08:59:33 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 821F7800CE0; Mon, 30 Nov 2020 10:59:32 -0600 (CST) Date: Mon, 30 Nov 2020 10:59:32 -0600 From: Justin Pryzby To: Peter Eisentraut Cc: David Rowley , Tom Lane , pgsql-hackers@postgresql.org, Andres Freund Subject: Re: jit and explain nontext Message-ID: <20201130165932.GA7242@telsasoft.com> References: <3643530.1602724513@sss.pgh.pa.us> <20201015014326.GU9241@telsasoft.com> <20201017192134.GD9241@telsasoft.com> <20201120161622.GI24784@telsasoft.com> <20201121162600.GN24784@telsasoft.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="9jxsPFA5p3P2qPhR" Content-Disposition: inline In-Reply-To: <20201121162600.GN24784@telsasoft.com> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --9jxsPFA5p3P2qPhR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. --9jxsPFA5p3P2qPhR Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v2-0001-explain-show-JIT-details-in-non-text-format-even-.patch" From 8a580c7a90e9854d53c15b69e761161330a6bf87 Mon Sep 17 00:00:00 2001 From: Justin Pryzby 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 --9jxsPFA5p3P2qPhR--