Skip to content

Disable JIT in Postgres settings#435

Open
relicode wants to merge 1 commit intoOverv:masterfrom
relicode:patch-1
Open

Disable JIT in Postgres settings#435
relicode wants to merge 1 commit intoOverv:masterfrom
relicode:patch-1

Conversation

@relicode
Copy link
Copy Markdown

@relicode relicode commented Oct 5, 2024

Use of PostgreSQL JIT is not recommended. It is enabled by default in PostgreSQL 12 and higher. JIT is benifitial for slow queries where executing the SQL takes substantial time and that time is not spent in function calls. This is not the case for rendering, where most time is spent either fetching from disk, in PostGIS functions, or the query is fast. In theory, the query planner will only use JIT on slower queries, but it is known to get the type of queries map rendering requires wrong.

More info

Use of PostgreSQL JIT is not recommended. It is enabled by default in PostgreSQL 12 and higher. JIT is benifitial for slow queries where executing the SQL takes substantial time and that time is not spent in function calls. This is not the case for rendering, where most time is spent either fetching from disk, in PostGIS functions, or the query is fast. In theory, the query planner will only use JIT on slower queries, but it is known to get the type of queries map rendering requires wrong.

https://github.com/gravitystorm/openstreetmap-carto/blob/master/INSTALL.md#disable-jit
@relicode relicode changed the title Disable JIT on Postgres settings Disable JIT in Postgres settings Oct 5, 2024
@docentYT
Copy link
Copy Markdown

You should use off, not false.

See boot_val and reset_val below.

# sudo -u postgres psql -d gis -c "select * from pg_settings where name like '%jit%';"
          name           | setting | unit |                        category                        |                         short_desc                          |          extra_desc          |      context      | vartype |       source       | min_val |   max_val    | enumvals | boot_val | reset_val |                      sourcefile                       | sourceline | pending_restart 
-------------------------+---------+------+--------------------------------------------------------+-------------------------------------------------------------+------------------------------+-------------------+---------+--------------------+---------+--------------+----------+----------+-----------+-------------------------------------------------------+------------+-----------------
 jit                     | off     |      | Query Tuning / Other Planner Options                   | Allow JIT compilation.                                      |                              | user              | bool    | configuration file |         |              |          | on       | off       | /etc/postgresql/15/main/conf.d/postgresql.custom.conf |         27 | f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants