-
Notifications
You must be signed in to change notification settings - Fork 921
is pq memory friendly? #713
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
Comments
@timbunce You have that backwards. Those issues happen because pq uses a cursor underneath. If we read all the rows into memory first, we wouldn't have those issues. In other words, there's no need to use a cursor explicitly. |
I guess I should clarify: there's no need to use a cursor explicitly if you're only worried about memory usage. |
Yes, you're right, I'd got it backwards. Thanks @johto! |
@johto are you saying pq uses a server side or client side cursor? I can't seem to find any reference in the code base to a server side cursor except in unused error messages and types, maybe I'm missing something.. |
@mbeirouti it's implicit in the wire protocol. The unnamed portal acts like a server side cursor. |
@mbeirouti Just to clarify,
|
I need to query retrieve 10 million records with lib/pq.
Is rows.Next() memory friendly or do I have to use cursors?
The text was updated successfully, but these errors were encountered: