Re: BUG #17871: JIT during postgresql_fdw remote_estimates EXPLAIN have very negatively effect on planning time - Mailing list pgsql-bugs

From Andres Freund
Subject Re: BUG #17871: JIT during postgresql_fdw remote_estimates EXPLAIN have very negatively effect on planning time
Date
Msg-id 20230328182401.nthcfx66dctd5pel@awork3.anarazel.de
Whole thread Raw
In response to Re: BUG #17871: JIT during postgresql_fdw remote_estimates EXPLAIN have very negatively effect on planning time  (Maxim Boguk <maxim.boguk@gmail.com>)
List pgsql-bugs
Hi,

On 2023-03-28 13:27:51 +1100, Maxim Boguk wrote:
> Simplest case show huge difference in theEXPLAIN performance with and
> without JIT:
> negotiation_chat_archive=# set jit to on;
> SET
> negotiation_chat_archive=# explain select * FROM
> public.interview_review_info_archive;
>                                                                      QUERY
> PLAN
>
-----------------------------------------------------------------------------------------------------------------------------------------------------
>  Gather  (cost=100.00..4602434.79 rows=354847702 width=40)
>    Workers Planned: 7
>    ->  Parallel Append  (cost=0.00..1053857.77 rows=50692498 width=40)
>          ->  Parallel Seq Scan on interview_review_info_archive_p030
> interview_review_info_archive_30  (cost=0.00..200959.41 rows=15759281
> width=40)
> ...
>          ->  Parallel Seq Scan on interview_review_info_archive_p005
> interview_review_info_archive_5  (cost=0.00..0.11 rows=1 width=40)
>          ->  Parallel Seq Scan on interview_review_info_archive_p009
> interview_review_info_archive_9  (cost=0.00..0.11 rows=1 width=40)
> (103 rows)
>  JIT:
>    Functions: 200
>    Options: Inlining true, Optimization true, Expressions true, Deforming
> true
> (106 rows)
> Time: 33.664 ms
> PS: this sample contradicts Andreas' statement about "It should not trigger
> all of JIT, just generating the bitcode, but not optimizing / emitting it."
> (or I read EXPLAIN output wrong.)

I think you might be misreading it. The output just tells you that we would
perform optimization etc, not that we did.

Upthread JIT caused the explain to take 100ms, here it's "just" 33ms. What's
the difference?

Greetings,

Andres Freund



pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #17775: Clarify default value for HEADER argument in documentation
Next
From: Andres Freund
Date:
Subject: Re: BUG #17871: JIT during postgresql_fdw remote_estimates EXPLAIN have very negatively effect on planning time