Home > Net >  Why postgresql planner generates different executions between linux and Windows
Why postgresql planner generates different executions between linux and Windows

Time:05-10

We use Postgresql locally with very large queries (joins, subrequests and recursion). On windows, the requests are executed in 4 to 8 seconds depending on the machines tested. This time is acceptable. But on linux machines, we go to 3minutes 30 minimum for the same queries and the same dataset. We don't understand why changing OS degrades performance so much. There is the request, the explain(analyze, buffer) on linux and on windows.

The request is generated by our tool, so we are not looking to correct this request. We can install Windows Server for the database, but we hope you can help us figure out why.

We have tested the following leads without success:

  • hardware differences (all machines have the same RAM, similar SSDs and processors)
  • the health of the disks and the RAM of the machines
  • all configurations and versions of postgresql instances are the same
  • the maintenance operations (vacuums and analyses) have been carried out.
  • Datas are the same across instances (export and imported with pgAdmin)

Do you have any idea where this could come from ? Why postgresql generates plans with totally different execution times depending on the OS ?

CodePudding user response:

On Linux, essentially all (204015.385 out of 217006.663 ms) of the time is spent on JIT (just in time compilation) in a vain attempt to make things faster. Just turn off jit, it is rarely useful in my experience.

On Windows, you probably have the fortune of not supporting JIT in the first place.

  • Related