Problem
_generate_csv_rows materializes all match results via list(yield_per(...)) before generating rows. This works at current scale (<10K) but will hit memory limits at 100K+ rows.
Approach
- Replace materialized list with cursor-based pagination through
_generate_csv_rows
- Stream CSV rows via
StreamingResponse with backpressure
- Yield rows in batches to avoid unbounded memory growth
- Preserve existing export format and behavior
Sub-tasks
Context
Identified as deferred follow-up from PR #124 (cursor-based keyset pagination). Low priority — current scale is <10K rows.
Problem
_generate_csv_rowsmaterializes all match results vialist(yield_per(...))before generating rows. This works at current scale (<10K) but will hit memory limits at 100K+ rows.Approach
_generate_csv_rowsStreamingResponsewith backpressureSub-tasks
_generate_csv_rowsStreamingResponsein campaign router export endpointContext
Identified as deferred follow-up from PR #124 (cursor-based keyset pagination). Low priority — current scale is <10K rows.