Re: [RFC] Add jit deform_counter - Mailing list pgsql-hackers

From Dmitry Dolgov
Subject Re: [RFC] Add jit deform_counter
Date
Msg-id 20230331173927.dbrijsjt2aotvshy@erthalion
Whole thread Raw
In response to Re: [RFC] Add jit deform_counter  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: [RFC] Add jit deform_counter  (Dmitry Dolgov <9erthalion6@gmail.com>)
List pgsql-hackers
> On Wed, Mar 29, 2023 at 01:50:37PM +1300, David Rowley wrote:
> On Sun, 12 Jun 2022 at 21:14, Dmitry Dolgov <9erthalion6@gmail.com> wrote:
> > I've noticed that JIT performance counter generation_counter seems to include
> > actions, relevant for both jit_expressions and jit_tuple_deforming options. It
> > means one can't directly see what is the influence of jit_tuple_deforming
> > alone, which would be helpful when adjusting JIT options. To make it better a
> > new counter can be introduced, does it make sense?
>
> I'm not so sure about this idea. As of now, if I look at EXPLAIN
> ANALYZE's JIT summary, the individual times add up to the total time.
>
> If we add this deform time, then that's no longer going to be true as
> the "Generation" time includes the newly added deform time.
>
> master:
>  JIT:
>    Functions: 600
>    Options: Inlining false, Optimization false, Expressions true, Deforming true
>    Timing: Generation 37.758 ms, Inlining 0.000 ms, Optimization 6.736
> ms, Emission 172.244 ms, Total 216.738 ms
>
> 37.758 + 6.736 + 172.244 = 216.738
>
> I think if I was a DBA wondering why JIT was taking so long, I'd
> probably either be very astonished or I'd report a bug if I noticed
> that all the individual component JIT times didn't add up to the total
> time.
>
> I don't think the solution is to subtract the deform time from the
> generation time either.
>
> Can't users just get this by looking at EXPLAIN ANALYZE with and
> without jit_tuple_deforming?

It could be done this way, but then users need to know that tuple
deforming is included into generation time (I've skimmed through the
docs, there seems to be no direct statements about that, although it
could be guessed). At the same time I don't think it's very
user-friendly approach -- after all it could be the same for other
timings, i.e. only one counter for all JIT operations present,
expecting users to experiment how would it change if this or that option
will be different.

I agree about adding up to the total time though. What about changing
the format to something like this?

   Options: Inlining false, Optimization false, Expressions true, Deforming true
   Timing: Generation 37.758 ms (Deforming 1.234 ms), Inlining 0.000 ms, Optimization 6.736 ms, Emission 172.244 ms,
Total216.738 ms
 

This way it doesn't look like deforming timing is in the same category
as others, but rather a part of another value.



pgsql-hackers by date:

Previous
From: Kirk Wolak
Date:
Subject: Re: SELECT INTO without columns or star
Next
From: Jacob Champion
Date:
Subject: Re: [PATCH] Add `verify-system` sslmode to use system CA pool for server cert