Problem
The SQLite export path materializes all rows in Python via fetchall() before writing them out. That is a memory-risky pattern and will scale poorly as export sizes increase.
Proposed change
- replace
fetchall()-style SQLite export generation with batched fetch/write logic
- measure memory and latency impact using backend benchmarks or focused export tests
Likely files
server/export_service.py
- export-related tests and benchmarks
Acceptance criteria
- SQLite export path does not require materializing the full result set in memory
- existing export API behavior remains correct
- tests cover large-ish result export behavior
Problem
The SQLite export path materializes all rows in Python via
fetchall()before writing them out. That is a memory-risky pattern and will scale poorly as export sizes increase.Proposed change
fetchall()-style SQLite export generation with batched fetch/write logicLikely files
server/export_service.pyAcceptance criteria