Skip to content

Avoid JIT compilation on measured assistant reads - #248

Merged
kinqsradio merged 1 commit into
mainfrom
fix/assistant-read-compilation
Oct 30, 2026
Merged

kinqsradio merged 1 commit into
mainfrom
fix/assistant-read-compilation

Conversation

@kinqsradio

Copy link
Copy Markdown
Member

Production chat-list reads spent substantial time compiling a large authorization query: EXPLAIN selected 13,751 JIT functions. Add an explicit transaction-local JIT opt-out for measured assistant-profile, notification and chat-list GET routes. Keep the authorization SQL and response fields unchanged, preserve primary/replica consistency routing and the profile's primary repeatable-read snapshot, and reset the setting automatically at transaction end.

A controlled production read used one read-only repeatable-read snapshot: JIT on 19.4s, off 8.2s, with identical complete JSON hashes (50 rows, one query each). This is one comparison, not a p95 claim; residual planning/execution time remains.

Validation: 23 focused database/HTTP/profile/origin/notification tests passed, including JIT result parity, read-only enforcement, pooled setting reset after commit and failures, private/retained summary filtering, and primary/replica routing. Backend typecheck, scoped formatting and diff checks passed. No global database setting changes. Hosted CI is not awaited per maintainer instruction.

@kinqsradio
kinqsradio merged commit 64f8ac7 into main Oct 30, 2026
1 check passed
@kinqsradio
kinqsradio deleted the fix/assistant-read-compilation branch November 2, 2026 07:56
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.

1 participant