ITPUB
Apr 29, 2016 · Databases
How to Stream Large MySQL Query Results Without Running Out of Memory
MySQL normally loads an entire query result into memory, which can cause out‑of‑memory errors on large tables, but by adding the -q option in the console, enabling useCursorFetch in JDBC URLs, and setting stmt.setFetchSize(Integer.MIN_VALUE), you can switch to a streaming mode that returns rows one at a time.
JDBCMemoryMySQL
0 likes · 3 min read
