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.