On Wed, 29 Mar 2023 at 07:33, Andres Freund <andres@anarazel.de> wrote:
>
> On 2023-03-28 16:05:00 +1300, David Rowley wrote:
> > I guess that means just add a check for EXEC_FLAG_EXPLAIN_ONLY in
> > jit_compile_expr, or only set the es_jit_flags bits in
> > standard_ExecutorStart() when not in EXEC_FLAG_EXPLAIN_ONLY. I'm not
> > really sure which of those is better, but the attached does the former
> > and seems to fix the issue.
>
> I'm a bit worried about either of these making EXPLAIN less informative. Right
> now we can see whether and how much would be JITed without ANALYZE. After this
> not anymore.
If you're worried about that, then wouldn't it just be better to do
something like have jit_compile_expr() increment some other counter
when bailing on EXEC_FLAG_EXPLAIN_ONLY then have EXPLAIN add that
counter to created_functions? With that, we don't need to invent any
new syntax and also remove the overhead from EXPLAIN and also keep the
JIT information.
David