Skip to main content

session_options

Function session_options 

Source
pub fn session_options(options: PgConnectOptions) -> PgConnectOptions
Expand description

Session settings of every TeamCraft connection, sent with the startup message (no extra round trip):

  • jit = off – TeamCraft runs short interactive queries; on a large vault the planner’s cost estimates cross jit_above_cost and the JIT compilation (100–400 ms in the scale check) costs far more than it saves. Analytical work on the same server keeps its own setting.
  • plan_cache_mode = force_custom_plan – sqlx keeps prepared statements per connection; after five runs PostgreSQL may switch a statement to a generic plan that ignores the actual parameters. For = ANY($1) over a BOM level or the parents of a standard part, the array holds one id or thousands, and a generic plan chosen for one is wrong for the other (the scale check saw 70 ms become 400 ms). Planning each run costs far less than such a plan.