Re: Add parameter jit_warn_above_fraction

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add parameter jit_warn_above_fraction
Date: 2022-02-25 16:01:41
Message-ID: 20220225160141.k35qjyysclouw5xc@jrouhaud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Fri, Feb 25, 2022 at 04:16:01PM +0100, Magnus Hagander wrote:
> This patch adds a configuration parameter jit_warn_above_fraction that
> will cause a warning to be logged if the fraction of time spent on
> doing JIT is bigger than the specified one. For example, this can be
> used to track down those cases where JIT ends up taking 90% of the
> query runtime because of bad estimates...

I think that's tremendously useful, huge +1.

Just a few minor nit:

+ A value of 0 (the default)disables the warning.

missing space

+ ereport(WARNING,
+ (errmsg("JIT time was %ld ms of %d ms",
+ jit_time, msecs)));

"JIT time" may a bit obscure for users, how about "JIT total processing time"?"

+ gettext_noop("Sets the fraction of query time spent on JIT before writing"
+ "a warning to the log."),
+ gettext_noop("Write a message tot he server log if more than this"
+ "fraction of the query runtime is spent on JIT."
+ "Zero turns off the warning.")

missing spaces in the concatenated strings.

The rest of the patch looks good to me.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-02-25 16:20:43 Re: Add parameter jit_warn_above_fraction
Previous Message Magnus Hagander 2022-02-25 15:41:22 Re: Expose JIT counters/timing in pg_stat_statements