Skip to content

Performance discrepancy while fetching large datasets using node-oracledb@5.5.0 vs SQL Developer #1750

@ashish3011

Description

@ashish3011

Environment

  • node-oracledb version: 5.5.0
  • Node.js version: 18.x

Problem Description

When fetching records from a table using node-oracledb, the performance is significantly slower compared to SQL Developer.

Table Schema

Table: 'PERFORMANCETEST'
ROWS: ~7700
Query: 'SELECT ID FROM PERFORMANCETEST'

Observations

  • Node.js (execute): ~5.4 seconds
  • SQL Developer (script mode): ~630ms

Code Sample

const result = await connection.execute(
SELECT ID FROM PERFORMANCETEST,
[],
{
outFormat: oracledb.OUT_FORMAT_OBJECT
}
);

Table

CREATE TABLE PERFORMANCETEST (
id NUMBER PRIMARY KEY, name VARCHAR2(100)
);

INSERTION OF DATA

BEGIN
FOR i IN 1..7700 LOOP
INSERT INTO PERFORMANCETEST (id, name) VALUES (i, 'NAME_' || i);
END LOOP;
END;

Expected Behavious

Performance should be closer to SQL Developer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions