ChannelDB2

I created my DB2 (Enterprise Server (Linux DB2 v9.7.0.2) + federation Infosphere) a "wrapper" with a JDBC for postgres server. The installation was a success. I have a table in postgres with 1,000,000 records. When you run a simple "SELECT * FROM TABLE FETCH FIRST 10 ROWS ONLY" or "SELECT * FROM TABLE WHERE ID < 10 " DB2 takes almost 3 minutes and leaves from a -901 sqlcode. What can I do to improve performance. 


Here's my script creation wrapprer : 


CREATE WRAPPER JDBC LIBRARY 'libdb2rcjdbc.so'; 


CREATE SERVER jdbc_post42 

TYPE JDBC 

VERSION '4.0' 

WRAPPER JDBC 

OPTIONS( ADD 

DRIVER_PACKAGE '/opt/jdbc/postgresql-8.4-702.jdbc4.jar', 

URL 'jdbc:postgresql://192.168.1.42:5432/database', 

DRIVER_CLASS 'org.postgresql.Driver', 

DB2_IUD_ENABLE 'Y', 

db2_char_blankpadded_comparison 'Y', 

db2_varchar_blankpadded_comparison 'Y', 

VARCHAR_NO_TRAILING_BLANKS 'Y', 

JDBC_LOG 'Y'); 


CREATE USER MAPPING FOR DB2INST1 SERVER JDBC_POST42 OPTIONS ( ADD REMOTE_AUTHID 'postgres', ADD REMOTE_PASSWORD '*****') ; 


CREATE NICKNAME TEST.TABLE FOR JDBC_POST42.public."tabela"; 


GRANT ALL ON TABLE TEST.TABLE TO PUBLIC; 



tks a lot

Views: 260

Replies to This Discussion

Hello,

Have you got any diagnostic message in the postgresql server diag log ?
If not, it looks like a connection timeout problem.
Activate JDBC trace and reissue the query.
Also contact IBM support.

Regards.
--
Yves-Antoine Emmanuelli
-901 is a internal error in DB2 LUW - some error condition that DB2/Federation can not assign a proper SQL code. You need to contact IBM support resolve the problem.
BTW, you may use Federation ODBC wrapper to connect to postgres . That could have better performance than JDBC wrapper since JDBC wrapper involve Java/JVM.

RSS

Try BLU Acceleration on Cloud

© 2014   Created by channeldb2.

Badges  |  Report an Issue  |  Terms of Service