Log the query for each export.
Write-as-you-go export for CSV, hoping to handle larger datasets.