From: adrklos <noreply@github.com>
To: pgsql-jdbc@lists.postgresql.org
Subject: [pgjdbc/pgjdbc] 5bb5f4: feat: implementation of adaptive fetching (#1707)
Date: Mon, 24 Feb 2020 05:58:24 -0800
Message-ID: <pgjdbc/pgjdbc/push/refs/heads/master/630692-5bb5f4@github.com> (raw)
Branch: refs/heads/master
Home: https://github.com/pgjdbc/pgjdbc
Commit: 5bb5f409b8372e4be86c14a00309ab60b8e17ed8
https://github.com/pgjdbc/pgjdbc/commit/5bb5f409b8372e4be86c14a00309ab60b8e17ed8
Author: adrklos <adrian.kloskowski@heimdalldata.com>
Date: 2020-02-24 (Mon, 24 Feb 2020)
Changed paths:
M README.md
M docs/documentation/head/connect.md
M pgjdbc/src/main/java/org/postgresql/PGConnection.java
M pgjdbc/src/main/java/org/postgresql/PGProperty.java
M pgjdbc/src/main/java/org/postgresql/PGStatement.java
M pgjdbc/src/main/java/org/postgresql/core/PGStream.java
M pgjdbc/src/main/java/org/postgresql/core/QueryExecutor.java
M pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java
A pgjdbc/src/main/java/org/postgresql/core/v3/adaptivefetch/AdaptiveFetchQueryInfo.java
A pgjdbc/src/main/java/org/postgresql/core/v3/adaptivefetch/AdaptiveFetchQueryMonitoring.java
M pgjdbc/src/main/java/org/postgresql/ds/common/BaseDataSource.java
M pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java
M pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
M pgjdbc/src/main/java/org/postgresql/jdbc/PgStatement.java
A pgjdbc/src/test/java/org/postgresql/core/v3/adaptivefetch/AdaptiveFetchQueryMonitoringTest.java
M pgjdbc/src/test/java/org/postgresql/test/jdbc2/Jdbc2TestSuite.java
A pgjdbc/src/test/java/org/postgresql/test/jdbc42/AdaptiveFetchSizeTest.java
M pgjdbc/src/test/java/org/postgresql/test/jdbc42/Jdbc42TestSuite.java
Log Message:
-----------
feat: implementation of adaptive fetching (#1707)
* feat: implementation of adaptive fetching
Implementation of adaptive fetching logic during process of fetching result set.
Change adds three new properties used with adaptive fetching:
- adaptiveFetch - use to enable/disable work of adaptive fetching
- adaptiveFetchMinimum - use to define minimum size computed during adaptive fetching
- adaptiveFetchMaximum - use to define maximum size computed during adaptive fetching
Adaptive fetching is used to compute fetch size to fully use size defined by maxResultBuffer.
Computing is made by dividing maxResultBuffer size by max row result size noticed so far.
Each query have separate adaptive fetch size computed, but same queries have it shared.
If adaptive fetch is turned on, first fetch is going to be made with defaultRowFetchSize,
next fetching of resultSet will be made with computed adaptive fetch size.
If adaptive fetch is turned on during fetching, then first fetching made by ResultSet will
be made with defaultRowFetchSize, next will use computed adaptive fetch size.
Additionally, resultSet have new method - getLastUsedFetchSize to get fetch size used during
last fetching. If adaptive fetching is turned on, then getFetchSize will return lastUsedFetchSize.
Property adaptiveFetch need properties defaultRowFetchSize and maxResultBuffer to work.
Commit to add:
- unit tests for AdaptiveFetchQueryMonitoring class;
- some style fixes (removing extra spaces, simpler code in setMaxRowSize method in PGStream class).
Commit to add:
- integration tests for adaptive fetching process;
- change casting to from primitive types to Wrapper classes in AdaptiveFetchQueryMonitoringTest.
Change in AdaptiveFetchSizeTest:
- is using PreparedStatement during tests now;
- added assume to check if preferQueryMode is not Simple;
- new method to open connection and creating table to remove code repetitiveness.
Commit to add explanation about adaptive fetching process in AdaptiveFetchQueryMonitoring class.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: noreply@github.com
Subject: Re: [pgjdbc/pgjdbc] 5bb5f4: feat: implementation of adaptive fetching (#1707)
In-Reply-To: <pgjdbc/pgjdbc/push/refs/heads/master/630692-5bb5f4@github.com>
References: <pgjdbc/pgjdbc/push/refs/heads/master/630692-5bb5f4@github.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox