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 1kg95J-0002fN-5d for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Nov 2020 16:16:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kg95I-0002pL-0J for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Nov 2020 16:16:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kg95H-0002pB-Pn for pgsql-hackers@lists.postgresql.org; Fri, 20 Nov 2020 16:16:27 +0000 Received: from mail-io1-xd42.google.com ([2607:f8b0:4864:20::d42]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kg95F-00007M-5e for pgsql-hackers@postgresql.org; Fri, 20 Nov 2020 16:16:26 +0000 Received: by mail-io1-xd42.google.com with SMTP id i9so10469047ioo.2 for ; Fri, 20 Nov 2020 08:16:25 -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=8XG/cKpd4R9Sby7y3jnnV2F8YyyNSnMhpStpvQ6SfTI=; b=1DnBH+VdVN1/CiAr+DIShTjLnexdp4blkmdGcq1wG1onxboKXUFVD/DhSW9SLMP8Zi YaF00kYHZpJvrfGVcJUQ88Hskwy+ylXUY2meYYlXWtxfkLBcmvptSOl685QJpe+kMsTJ n/dgiUZzk3kBHDkLeFjHmB3YdUKb68UVQ4saeDXpI6pX/XjD6cJRFQS2IRe43uCv/1OG MaseiyPMutEj/SxTNaBbUbBmjyV0GgUDwIqbJE9wsDeKEmoYTi1jMko0VEzna1XHIV66 jiC783w7Ud9IeoV228MlHpdG3/hgaqVc+xETB+HwqSExZ3AHwk99IRT9fqxRu1Cwq444 xizw== 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=8XG/cKpd4R9Sby7y3jnnV2F8YyyNSnMhpStpvQ6SfTI=; b=nNDV9I8KeUOy+0yOg+Un/371pip71N77OaoGrtNhUuQTGoObO0FparhPIddtlsP40B 0QLoEihFbsAdhpIz0KmieptefNYJ5QfbXeF1aD/6KyrFuig6wDP83kRbdUvZWw2+2uhQ b3mJ1aMLNTSDf5kcdi2IEsrGinVVyEqLupkWE8Emx6xcoKGxIeFeWrjMMHR6by9ffC2A G0dkBufAm4UKsW2OcI0yQaSVGPsqLBzvOMEUUhE7X4KQNWPAlFUQSQyBPLbW4pBTLgHf nH5g6+xASE/wLuGGlUlkHZc4wExQVIFA0cjVSMkW8h87RAjBlEAc/vjdVjKa+Mu8Nu3s xbCA== X-Gm-Message-State: AOAM531iRjhQcVpxmN8d8kAQ0sIC9YrSgVKz03qMX97Z8w2IjZt+iIVU j5faBuPWwqdgMsEIbSN5pozINg== X-Google-Smtp-Source: ABdhPJz7gcFvhkIwpqETRu9LZako+y5f68EmhK0Pkec8nnBYmQi7leBcuoS6/YxAIEDs0VVFlzCH4w== X-Received: by 2002:a6b:8f50:: with SMTP id r77mr25680385iod.141.1605888984456; Fri, 20 Nov 2020 08:16:24 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id l9sm2187193ilt.19.2020.11.20.08.16.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Nov 2020 08:16:23 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 95BB58006CE; Fri, 20 Nov 2020 10:16:22 -0600 (CST) Date: Fri, 20 Nov 2020 10:16:22 -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: <20201120161622.GI24784@telsasoft.com> References: <20201014193859.GS9241@telsasoft.com> <3643530.1602724513@sss.pgh.pa.us> <20201015014326.GU9241@telsasoft.com> <20201017192134.GD9241@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Nov 20, 2020 at 04:56:38PM +0100, Peter Eisentraut wrote: > On 2020-10-17 21:21, Justin Pryzby wrote: > > Added at:https://commitfest.postgresql.org/30/2766/ > > > > 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 */ > > Can you show an output example of where this patch makes a difference? Just > from reading the description, I would expect some kind of additional > JIT-related output from something like > > EXPLAIN (FORMAT YAML) SELECT 1; 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. -- Justin