Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support node-oracledb 'arraysize' for tuning multi-row fetch performance #4964

@cjbj

Description

@cjbj

Environment

Knex version: master
Database + version: Oracle
OS: all

Feature discussion / request

@atiertant the current recommended way to tune fetching of multiple rows is with fetchArraySize. Knex can support this similar to how prefetchRows and stmtCacheSize are supported.

A diff is:

@@ -124,6 +124,11 @@
         client.connectionSettings
       );
 
+      if (client.connectionSettings.fetchArraySize) {
+        client.driver.fetchArraySize =
+          client.connectionSettings.fetchArraySize;
+      }
+
       if (client.connectionSettings.prefetchRowCount) {
         oracleDbConfig.prefetchRows =
           client.connectionSettings.prefetchRowCount;
@@ -180,7 +185,7 @@
                   return cb(err);
                 }
                 const fetchResult = { rows: [], resultSet: result.resultSet };
-                const numRows = 100;
+                const numRows = client.driver.fetchArraySize;
                 const fetchRowsFromRS = function (
                   connection,
                   resultSet,

at around https://github.com/knex/knex/blob/master/lib/dialects/oracledb/index.js#L138

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions