1

I have recently deployed PostgreSQL database on Linux server. One of the stored procedure is taking around 3 to 4 seconds to fetch the result. Previously i was deployed PostgreSQL database to windows server and the same stored procedure fetching result within second. I have checked execution plan in both the cases.
It is almost same but Linux execution plan contains below extra detail.

    JIT:
  Functions: 171
  Options: Inlining true, Optimization true, Expressions true, Deforming true
  Timing: Generation 26.548 ms, Inlining 8.198 ms, Optimization 2052.958 ms, Emission 1241.730 ms, Total 3329.434 ms

Let me know if you have any idea for above detail and have any root cause of slowness issue.

Nayan Rudani
  • 1,029
  • 3
  • 12
  • 21
  • Are networks exactly alike, or you running query on the server? – Rich Bianco Feb 01 '20 at 09:28
  • both are running in different server in the same data center. – Nayan Rudani Feb 01 '20 at 09:30
  • Loads of things it could be (machine specs, disk speeds, postgres version, configuration etc) but in this case, based on the "JIT:" in your question, I'd guess that [JIT compilation](https://www.postgresql.org/docs/11/jit-reason.html) is enabled on the linux box and not on windows. – Brits Feb 01 '20 at 09:42
  • Try disabling JIT on the Linux system –  Feb 01 '20 at 10:14

1 Answers1

1

It looks like JIT is doing you more harm than good on Linux, so turn it off, by for example putting jit=off in postgresql.conf file.

Your Windows version probably didn't come with JIT in the first place. The EnterpriseDB installer for Windows didn't include it, anyway. So even though the parameter jit shows as on, it doesn't do anything as there is nothing there to turn on.

jjanes
  • 37,812
  • 5
  • 27
  • 34