Issue Details (XML | Word | Printable)

Key: DERBY-822
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Knut Anders Hatlen
Reporter: Knut Anders Hatlen
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

Client driver: Pre-fetch data on executeQuery()

Created: 18/Jan/06 07:52 PM   Updated: 30/Jun/09 04:12 PM
Return to search
Component/s: Network Server
Affects Version/s: 10.2.1.6
Fix Version/s: 10.2.1.6

Time Tracking:
Issue & Sub-Tasks
Issue Only
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works DERBY-822-v1.diff 2006-02-17 10:58 PM Knut Anders Hatlen 813 kB
Text File Licensed for inclusion in ASF works DERBY-822-v1.stat 2006-02-17 10:58 PM Knut Anders Hatlen 1 kB
File Licensed for inclusion in ASF works DERBY-822-v2.diff 2006-04-05 09:56 PM Knut Anders Hatlen 12 kB
Text File Licensed for inclusion in ASF works DERBY-822-v2.stat 2006-04-05 09:56 PM Knut Anders Hatlen 0.5 kB
File Licensed for inclusion in ASF works DERBY-822-v3.diff 2006-04-18 04:51 AM Knut Anders Hatlen 10 kB
Text File Licensed for inclusion in ASF works DERBY-822-v3.stat 2006-04-18 04:51 AM Knut Anders Hatlen 0.5 kB

Issue & fix info: Release Note Needed
Bug behavior facts: Performance
Resolution Date: 18/Apr/06 01:55 PM

Sub-Tasks  All   Open   
No sub-tasks match this view.

 Description  « Hide
Currently, the client driver does not pre-fetch data when
executeQuery() is called, but it does on the first call to
ResultSet.next(). Pre-fetching data on executeQuery() would reduce
network traffic and improve performance.

The DRDA protocol supports this. From the description of OPNQRY (open
query):

  The qryrowset parameter specifies whether a rowset of rows is to be
  returned with the command. This is only honored for non-dynamic
  scrollable cursors (QRYATTSNS not equal to QRYSNSDYN) and for
  non-scrollable cursors conforming to the limited block query
  protocol. The target server fetches no more than the requested
  number of rows. It may fetch fewer rows if it is restricted by extra
  query block limits, or if a fetch operation results in a negative
  SQLSTATE or an SQLSTATE of 02000.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #387214 Mon Mar 20 14:20:56 UTC 2006 kahatlen DERBY-1014: Make tests less sensitive to pre-fetching

Attached a patch (DERBY-1014-v1.diff) which modifies tests in
preparation for DERBY-822. There are two types of changes:

  1) Invoke ResultSet.next() to expose error even when the driver
     isn't pre-fetching data.

  2) Filter out some of the run-time statistics before comparing with
     the canon.

lang/wisconsin.java:

  * Added patterns to the sed file. Cursor names and some of the
    run-time statistics are filtered out.

  * Canons for DerbyNet and DerbyNetClient were deleted since they are
    no longer needed. Each of these files is 1.5M, so the diff is
    huge.

lang/scrollCursors1.sql:

  * Added patterns to the sed file. Number of rows seen and number of
    reads from hash table will be filtered out.

jdbcapi/parameterMetaDataJdbc30.java:

  * Added a call to ResultSet.next() to provoke an error in a test
    case for DERBY-44 regardless of framework/pre-fetching.

jdbcapi/resultset.java:

  * Don't print column headers until one row is successfully retrieved
    (achieved by calling ResultSet.next() earlier).

jdbcapi/setTransactionIsolation.java:

  * Added a call to ResultSet.next() to provoke a timeout regardless
    of framework/pre-fetching.

  * Added patterns to the sed file. Filtered out number of pages
    visited, number of rows qualified/visited etc.
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/setTransactionIsolation.out
DEL /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/wisconsin.out
ADD /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors1_sed.properties
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/setTransactionIsolation_sed.properties
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/resultset.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/setTransactionIsolation.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMetaDataJdbc30.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/scrollCursors1.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/setTransactionIsolation.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultset.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/setTransactionIsolation.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/wisconsin.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/wisconsin_sed.properties
DEL /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/wisconsin.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/scrollCursors1.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors1.out

Repository Revision Date User Message
ASF #394859 Tue Apr 18 06:41:04 UTC 2006 kahatlen DERBY-822: Client driver: Pre-fetch data on executeQuery()

This patch makes the network server include query data when it replies
to an OPNQRY command. (Query data is only included when there are no
LOB columns and the protocol is limited block protocol.)
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/supersimple.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/forupdate.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/values1.inc
MODIFY /db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java
MODIFY /db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/supersimple.out
MODIFY /db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java