Stream CSV exports instead of loading every row #218
main from fix/stream-csv-export| 40 | export async function exportCSV(query, stream) { |
| 41 | const rows = await db.select(query) |
| 42 | return toCSV(rows) |
| 41 | for await (const page of db.pages(query, 1000)) { |
| 42 | stream.write(toCSV(page)) |
| 43 | } |
| 44 | } |
- All checks passed · 148 tests, typecheck, guardrails armed
- Maya approved these changes
- Maya merged behind the flag
export_streaming - Rolled out 1% → 10% → 50% → 100%, no guardrail tripped
export_success_rate, 62% → 96% after merge · dotted line is the 10% holdout
OPP-11812 accounts ($184k ARR) cannot export tables over 10k rows. Exports load every row into memory and time out.
sentryTypeError in /export, 212 events in 7 dayszendesk“Export is greyed out for our big tables”gong“We’d pay for a bigger plan if exports worked”posthog31.4% of export_clicked never reach export_done