pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feedFrom: Chris-SP365 (@Chris-SP365) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] issue #3483: Support adaptive fetching without enforcing memory limits, and/or have a separate buffer size for it
Date: Mon, 27 Jan 2025 12:31:16 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
> We can't multiplex over the single connection, so we would have to consume and buffer the leftover in that case.
This is the way multiple other database vendors JDBC implementations do it.
SQL Server by default:
https://learn.microsoft.com/en-us/sql/connect/jdbc/using-adaptive-buffering?view=sql-server-ver16
"Avoid executing more than one statement on the same connection simultaneously. Executing another statement before processing the results of the previous statement may cause the unprocessed results to be buffered into the application memory."
MariaDB with setFetchSize(1)
https://mariadb.com/kb/en/about-mariadb-connector-j/#streaming-result-sets
If another query is run on same connection while the resultset has not been completly read, the connector will fetch all remaining rows before executing the query. This can lead to still needing lots of memory. Recommendation is then to use another connection for simultaneous operations.
MySQL with setFetchSize(Integer.MIN_VALUE) throws an exception
https://dev.mysql.com/doc/connector-j/en/connector-j-reference-implementation-notes.html
"There are some caveats with this approach. You must read all of the rows in the result set (or close it) before you can issue any other queries on the connection, or an exception will be thrown. "
Result set streaming was our reason to switch to [PGJDBC-NG](https://impossibl.github.io/pgjdbc-ng/) which has the ability to stream the result set row by row. Our implementation does not issue a second command over one connection, it's just using a separate connection. So this is not a problem for us.
@james-johnston-thumbtack would that behaviour help you?
view thread (20+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: github://pgjdbc/pgjdbc
Cc: [email protected], [email protected]
Subject: Re: [pgjdbc/pgjdbc] issue #3483: Support adaptive fetching without enforcing memory limits, and/or have a separate buffer size for it
In-Reply-To: <<[email protected]>>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox