pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: mirraj2 (@mirraj2) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: [pgjdbc/pgjdbc] issue #2656: Adaptive Fetch doesn't enable ResultSet streaming
Date: Sat, 29 Oct 2022 18:21:26 +0000
Message-ID: <[email protected]> (raw)

**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.

view thread (12+ 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 #2656: Adaptive Fetch doesn't enable ResultSet streaming
  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