The 'refuse unless provably identical' design is the part I find most interesting. Recording the compiled SQL at startup assumes the QuerySet's shape is fixed, but things like database routers, per-request tenant schemas, or a changed search_path could alter the SQL or the target connection without the route code changing. Does quickset key the recording on the connection alias and any router decision, or are routers one of the refusal cases? Also curious how it handles parameter-dependent query shapes, such as a filter that is skipped when min_score is 0, since that changes the SQL text rather than just the bound values.
A nonempty DATABASE_ROUTERS setting keeps the route on Django’s ORM. Otherwise Quickset records one connection alias and checks it across samples. Rust uses its own pool and doesn’t track search_path per request. I’d leave a tenant-dependent route on the ORM.
Your if min_score: example also stays on the ORM. A straight .filter(score__gte=min_score) is supported, including when Django drops the predicate or skips the query.
No. On the Rust route, the request goes straight to Rust and PostgreSQL. Python middleware and Bolt’s auth checks never run. The 19× result was one public route on Bolt master. Routes with auth or guards stay in Python. I haven’t benchmarked an authenticated route.
Makes sense for public reads, and 2x on auth routes is a nice bonus. Still makes me wonder how maintainable that split becomes once the codebase grows.
AI Developer
The 'refuse unless provably identical' design is the part I find most interesting. Recording the compiled SQL at startup assumes the QuerySet's shape is fixed, but things like database routers, per-request tenant schemas, or a changed search_path could alter the SQL or the target connection without the route code changing. Does quickset key the recording on the connection alias and any router decision, or are routers one of the refusal cases? Also curious how it handles parameter-dependent query shapes, such as a filter that is skipped when min_score is 0, since that changes the SQL text rather than just the bound values.