{"Entry":{"collection":"guc","key":"jit_inline_above_cost","name":"jit_inline_above_cost","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Query Tuning / Planner Cost Constants","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"10","status":"added","to":"11"}],"content_hash":"228aabaff9fa5abcd1b2a042b100dc3b5304bed4fb2dc025b84843637f7e80f0","context":"","default_changed_in":[],"default_history":[{"from":"11","to":"19","value":"500000"}],"editorial":{"advice":{"olap":"For long CPU-bound queries, benchmark total elapsed time on both sides of jit_inline_above_cost. Lowering the threshold is useful only when saved execution CPU consistently exceeds compilation overhead.","oltp":"Do not lower jit_inline_above_cost globally to chase a single CPU-heavy statement. Compilation latency is visible in short-query tails; test at statement or role scope and include JIT generation time in the result.","small":"Keep the default or disable the stage with -1 when LLVM work competes with a small CPU budget. Estimated cost alone does not prove that JIT will pay back its startup cost."},"mechanism":["jit_inline_above_cost compares the finished plan's estimated cost with a threshold to decide whether PostgreSQL may run JIT inlining. The cost is the planner's arbitrary estimate, not milliseconds.","The decision occurs at plan time and only matters when JIT is enabled and a provider is available. Generic prepared plans retain the decision made when the generic plan was generated.","A value of -1 disables this stage. jit_inline_above_cost and jit_optimize_above_cost are additional gates after jit_above_cost, so setting either below the base compilation threshold is not meaningful. Its user context permits session- or transaction-local changes; newly performed or newly planned work sees the value."],"pitfalls":["Reading the threshold as milliseconds rather than arbitrary planner cost units.","Ignoring JIT generation, inlining, optimization, and emission time when benchmarking.","Expecting a changed value to alter a generic plan that was already generated.","Setting an advanced-stage threshold below jit_above_cost and expecting that stage to run by itself."],"references":[{"title":"PostgreSQL 19 Beta 4: jit_inline_above_cost","url":"https://www.postgresql.org/docs/19/runtime-config-query.html#GUC-JIT-INLINE-ABOVE-COST"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["jit","jit_above_cost","jit_optimize_above_cost","jit_expressions"],"summary":"jit_inline_above_cost — Perform JIT inlining if query is more expensive. Observed in PG11–19 Beta 4; its last measured boot default is 500000 in PG19 Beta 4, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"11","group":"Query Tuning","group_slug":"query","imported_at":"2026-09-27T17:57:31.434349+08:00","intro_commit":{"authored_at":"2018-03-28T13:19:08-07:00","discussion":["https://postgr.es/m/20170901064131.tazjxwus3k2w3ybh@alap3.anarazel.de"],"hash":"9370462e9a79755aea367c62eb0fef96f0c42258","subject":"Add inlining support to LLVM JIT provider.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=9370462e9a79755aea367c62eb0fef96f0c42258"},"key":"jit_inline_above_cost","last_version":"20","max_val":"","min_val":"","name":"jit_inline_above_cost","position":195,"present_in":["11","12","13","14","15","16","17","18","19","20"],"short_desc":"Sets the query cost above which JIT compilation attempts to inline functions and operators.","short_desc_zh":"","source_rev":"english-manuals:42edf2f504a5e7b009aeec4483e5b108b6c5a1cac869d48f894f6daf1547fee3","unit":"","vartype":"real"}},"Definition":{"Collection":"guc","Key":"jit_inline_above_cost","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"jit_inline_above_cost","SourceRevision":"english-manuals:42edf2f504a5e7b009aeec4483e5b108b6c5a1cac869d48f894f6daf1547fee3","Facts":{"boot_val":"500000","category":"Query Tuning / Planner Cost Constants","context":"user","description":"Sets the query cost above which JIT compilation attempts to inline functions and operators. Inlining adds planning time, but can improve execution speed. It is not meaningful to set this to less than jit_above_cost. Setting this to -1 disables inlining. The default is 500000.","doc":{"anchor":"GUC-JIT-INLINE-ABOVE-COST","file":"runtime-config-query.html","lang":"en","sha256":"33456ca7ef52bf28e93e34b932a411db7a1b95800179add2cf867dc6ec9144bc","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"-1 disables inlining.","lang":"en","max_val":"1.79769e+308","metadata_version":"18","min_val":"-1","name":"jit_inline_above_cost","short_desc":"Perform JIT inlining if query is more expensive.","source":"pg-settings-source-snapshot","unit":null,"vartype":"real"},"ManualEvidence":{"doc":{"anchor":"GUC-JIT-INLINE-ABOVE-COST","file":"runtime-config-query.html","lang":"en","sha256":"33456ca7ef52bf28e93e34b932a411db7a1b95800179add2cf867dc6ec9144bc","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"jit_inline_above_cost","SourceDatabase":"center","Version":"18","Locale":"en","Title":"jit_inline_above_cost","Summary":"Sets the query cost above which JIT compilation attempts to inline functions and operators. Inlining adds planning time, but can improve execution speed. It is not meaningful to set this to less than jit_above_cost. Setting this to -1 disables inlining. The default is 500000.","BodyHTML":"\u003cp\u003eSets the query cost above which JIT compilation attempts to inline functions and operators. Inlining adds planning time, but can improve execution speed. It is not meaningful to set this to less than jit_above_cost. Setting this to -1 disables inlining. The default is 500000.\u003c/p\u003e","SourceRevision":"english-manuals:42edf2f504a5e7b009aeec4483e5b108b6c5a1cac869d48f894f6daf1547fee3","ContentHash":"375ed4bb2f8d8fbd151f4bbdf6effe5a72db68160bfe4bdd08aa69308419d7e9","Payload":{"description":"Sets the query cost above which JIT compilation attempts to inline functions and operators. Inlining adds planning time, but can improve execution speed. It is not meaningful to set this to less than jit_above_cost. Setting this to -1 disables inlining. The default is 500000."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
