Message-ID: From: "mirraj2 (@mirraj2)" To: "pgjdbc/pgjdbc" Date: Sat, 29 Oct 2022 18:21:26 +0000 Subject: [pgjdbc/pgjdbc] issue #2656: Adaptive Fetch doesn't enable ResultSet streaming List-Id: X-GitHub-Author-Id: 847857 X-GitHub-Author-Login: mirraj2 X-GitHub-Issue: 2656 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: open X-GitHub-Type: issue X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/2656 Content-Type: text/plain; charset=utf-8 **Describe the issue** I enabled adaptiveFetch, however, all rows are being loaded into memory instead of allowing me to stream through the ResultSet **Driver Version?** 42.5.0 **Java Version?** java version "11.0.16" 2022-07-19 LTS **OS Version?** Mac OS 12.5 **PostgreSQL Version?** PostgreSQL 13.7 on aarch64-unknown-linux-gnu, compiled by gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), 64-bit **To Reproduce** 1. Use connection string with "?adaptiveFetch=true&defaultRowFetchSize=64&maxResultBuffer=128M" 2. execute a statement which selects all rows from a large table **Expected behaviour** I expect that when I call ResultSet.next(), it will return fairly quickly because it has only loaded part of the table. Instead, it takes a LONG time to load because it is loading the entire table into RAM. When I set the following code (even without adaptiveFetch turned on), it will correctly stream results: conn.setAutoCommit(false); statement.setFetchSize(4096); Additionally, I enabled the FINEST level of logging, but was unable to ascertain whether or not adaptiveFetch was even enabled. This makes it very hard for me to even know if my connectionUrl params are being ignored or not.