Message-ID: From: "davecramer (@davecramer)" To: "pgjdbc/pgjdbc" Date: Fri, 17 Jan 2025 09:39:55 +0000 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: References: List-Id: X-GitHub-Author-Login: davecramer X-GitHub-Comment-Id: 2597823337 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3483 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3483#issuecomment-2597823337 Content-Type: text/plain; charset=utf-8 > > > couldn't the ResultSet.next function stream the rows directly from the TCP socket without significant buffering? This would avoid the whole issue of buffer size management in the first place.) > > Imagine we don't fully consume the data from the socket. Imagine user executes yet another "prepare statement / execute call". We can't multiplex over the single connection, so we would have to consume and buffer the leftover in that case. > Interesting problem. One would have to at least consume everything before issuing the next query.