brianc/node-pg-cursor

JavaScript heap out of memory

jdelman opened this issue · 1 comments

I'm running into similar memory issues with pg-cursor and pg-query-stream. It seems like the cursors aren't being used, and I'm getting everything at once, which is resulting in a JavaScript heap out of memory error.

My query results in 1 million+ rows. It seems pg-cursor doesn't care the number of rows I give it to read, because it always returns the maximum number of rows. For a query like:

SELECT user
FROM events
ORDER BY created LIMIT 500;

I call cursor.read(100, (err, rows) => console.log(rows.length)) gives 500 instead of the expected 100.

Likewise, with pg-query-stream, my Node process eventually runs out of memory. I am using the latest versions of pg, pg-query-stream and pg-cursor. The only thing I can think of that might be throwing things off is that this is inside a Docker container.

Whoops, this is probably a Redshift issue so it's a dupe of #14. Sorry