perf(sync): reparse 按患者分批,避免全量时把全 host rawPayload 拉进内存 OOM
全量 reparse 时一次性 findMany 所有 rawPayload 可达 GB 级(服务器 diagnosis 975MB/541k txn)。 改为按患者 cohort 分批(PAC_REPARSE_BATCH,默认 3000):每批只重建该批的 distinct 源行 → transform → processSubject,内存恒定(本地实测 rss ~460MB);跨批累加 stats,supersededAt 圈出 变更患者定向重算。dry-run 改报 scope(count,不分批装配)。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Showing
Please
register
or
sign in
to comment