Skip to content

Switch to in-memory item selection to speed up export#5478

Merged
awwaiid merged 2 commits intomainfrom
speed-up-distribution-export
Jan 18, 2026
Merged

Switch to in-memory item selection to speed up export#5478
awwaiid merged 2 commits intomainfrom
speed-up-distribution-export

Conversation

@awwaiid
Copy link
Copy Markdown
Collaborator

@awwaiid awwaiid commented Jan 18, 2026

We pre-load distribution items, but when applying a sub-filter we were accidentally re-querying the database a bunch. This changes it to an in-memory filter.

  • Unit tests of the CSV export pass
  • Even better, on a production-dataset we exported all of 2025 for a user before and after and got identical files!!!!

@awwaiid awwaiid requested a review from dorner January 18, 2026 15:33
@awwaiid
Copy link
Copy Markdown
Collaborator Author

awwaiid commented Jan 18, 2026

We did not technically need to require csv, but did so so that the unit test would run by itself. Shouldn't hurt anything.

Co-authored-by: Scott Steele <scottlsteele@gmail.com>
Copy link
Copy Markdown
Collaborator

@scooter-dangle scooter-dangle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

El jee tea em! 👍

@awwaiid awwaiid merged commit 95cae51 into main Jan 18, 2026
27 of 28 checks passed
@awwaiid awwaiid deleted the speed-up-distribution-export branch January 18, 2026 15:46
@github-actions
Copy link
Copy Markdown
Contributor

@awwaiid: Your PR Switch to in-memory item selection to speed up export is part of today's Human Essentials production release: 2026.01.25.
Thank you very much for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants