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

[MySQL]: optimize result set streaming from iterator() #4126

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

reecefenwick
Copy link

@reecefenwick reecefenwick commented Feb 16, 2025

While testing the iterator I found it doesn't perform as well as I was expecting with really large datasets (1 million+ rows) based on past experiences with streams from mysql2

I've simplified the implementation to just use for await, it's functionally equivalent in terms of control flow and error handling, but consumes less resources in the process since we are allocating far less inside the loop.

A before and after streaming 1 million rows

Before: 22 Seconds

image

After: 8 seconds

image

@reecefenwick reecefenwick changed the title fix(mysql): optimize result set streaming from .iterator() [MySQL]: optimize result set streaming from .iterator() Feb 16, 2025
@reecefenwick reecefenwick changed the title [MySQL]: optimize result set streaming from .iterator() [MySQL]: optimize result set streaming from iterator() Feb 16, 2025
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.

1 participant