ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
188 stars 151 forks source link

Slow response to retrieve 11577 records took 20sec #998

Open KalyanMolakalapalli opened 6 days ago

KalyanMolakalapalli commented 6 days ago

Please provide below information while opening an issue to understand your problem

For non-Windows system, output of below commands from terminal:

uname uname -m node -v npm ls ibm_db db2level echo $IBM_DB_HOME echo $PATH echo $LD_LIBRARY_PATH $DYLD_LIBRARY_PATH

For Windows system, output of below commands from windows command prompt:

node -v 20.14.0 npm ls ibm_db ibm_db@3.2.4 db2level 2.7.1 echo %IBM_DB_HOME% node_modules\ibm_db\installer\clidriver echo %PATH% echo %LIB%

Please provide below problem specific info:

=========================================

For Installation related issue

For Connection related issue - connection is good , retrieving the data from DB2 is taking 20 sec for 11K records

  1. Are you trying SSL connection or non-SSL connection?
  2. For SSL Connection, please read and follow this documentation
  3. For SSL connection, do you have ssl certificate from server?
  4. If you have certificate, are you using SSLServerCertificate keyword in connection string or using your own keystore db?
  5. Share the connection string used for connection by masking password.
  6. update database connection info in ibm_db/test/config.json file and share complete output of below commands:
    • cd .../node_modules/ibm_db
    • npm install
    • node test/test-basic-test.js
  7. For non-SSL connection, update connection info for db2cli validate command in file ibm_db/installer/testODBCConnection.bat for windows or ibm_db/installer/testODBCConnection.sh for non-Windows. Then execute testODBCConnection.bat from Administrator command prompt on Windows or testODBCConnection.sh script from terminal on non-Windows and share complete output of script along will all generated 1.* files in zip file.
  8. Complete output of db2cli validate command.

For SQL1598N Error

For other issues

1. 2.

KalyanMolakalapalli commented 3 days ago

Can someone take a look into this issue and let us know what we should need to do to resolve the performance issue of ibm_db

bimalkjha commented 2 days ago

@KalyanMolakalapalli I think you observe more time consumption for large data because nodejs need to store all data in memory as an object and then return to the caller. To avoid it, you can try prepare, execute and then fetch() in a loop as in the example of fetchSync() API here

Also, to avoid buffering of data in nodejs memory, you can use queryStream() API in your program as used in test-queryStream.js test file. Try these methods and let me know your observations. Thanks.

KalyanMolakalapalli commented 1 day ago

thankyou @bimaljha will work on the above solutions.