Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Speed up CSV generation by minimizing DB probes #6577

Merged
merged 4 commits into from
Oct 1, 2024

Conversation

bshankar
Copy link
Collaborator

What type of PR is this? (check all applicable)

  • 🐛 Bug Fix

Describe this PR

Download CSV feature was unreasonably slow when the number of projects was high - 8 minutes for 2700 projects.
I moved the expensive DB calls outside the loop into just one query. It should be much faster now.

Review Guide

Use an DB with multiple users and lots of projects and task history. Preferably 2000+ projects in the search results. Press the download CSV button. Look for the right contributor count and the CSV file getting downloaded without a gateway timeout.

@ramyaragupathy
Copy link
Member

@bshankar bshankar force-pushed the download-csv-optimization branch 3 times, most recently from c293cb4 to f43feab Compare September 30, 2024 11:38
Copy link

sonarcloud bot commented Sep 30, 2024

@mahesh-naxa
Copy link
Collaborator

I just tested this on my local setup (2700ish projects), the download was success for all projects and just below timeout. For prod this should be even lower.
Thanks @bshankar

@mahesh-naxa
Copy link
Collaborator

@ramyaragupathy can be merged.

@ramyaragupathy ramyaragupathy merged commit 6b3fb73 into hotosm:develop Oct 1, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants