ab27d3a4da13e3a47f6af2c05dc2f367defc955d
A client's bank account and the financial account it posts to share a numeric code, and :journal-entry-line/account points at either entity. The register's Account search matched the selected entity id exactly, so picking a financial account missed every line posted to the bank account on that code -- while the Account Code range filter, which already or-joins both namespaces, found them. Resolve the shared bank accounts up front and pass the id set into the existing clause rather than or-joining inside the query: an or-join turns a selective indexed lookup into per-line work and measured 2.5-3.4x slower on every account search, including ones that share no code. When nothing shares the code the emitted query is unchanged, so the common case stays at parity (0.97-1.04x, plus ~0.2ms to resolve). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Description
No description provided
Languages
Clojure
91%
CSS
4.2%
Sass
2.3%
HTML
1.2%
HCL
0.4%
Other
0.7%