Re: BUG #17871: JIT during postgresql_fdw remote_estimates EXPLAIN have very negatively effect on planning time

From: Andres Freund <andres(at)anarazel(dot)de>
To: Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17871: JIT during postgresql_fdw remote_estimates EXPLAIN have very negatively effect on planning time
Date: 2023-03-28 18:24:01
Message-ID: 20230328182401.nthcfx66dctd5pel@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2023-03-28 18:31:10 Re: BUG #17871: JIT during postgresql_fdw remote_estimates EXPLAIN have very negatively effect on planning time
Previous Message Bruce Momjian 2023-03-28 18:12:00 Re: BUG #17775: Clarify default value for HEADER argument in documentation