Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: Tim MeagherHi,
I think that the problem here is that the MySQL JDBC driver will attempt to retrieve the entire result set for the query.
You can change the settings such that this is buffered somewhat, and the driver will return only the specified number of rows at a time.
The node will keep iterating over this until all rows have been retrieved, so it won't reduce the number of rows output by the node or anything like that.
You can do this by adding the following settings into your JDBC URL:
defaultFetchSize=<numRows>
useCursorFetch=true
Where <numRows> is obviously the number of rows returned by the driver per fetch.
A higher number of rows will use more memory, but execute faster, while a lower number of rows will use less memory, but be slower.
Tim.