Unix Technical Forum

Performance Tuning of batch insert and batch update using JDBC API.

This is a discussion on Performance Tuning of batch insert and batch update using JDBC API. within the Informix forums, part of the Database Server Software category; --> Hi All, I am trying to Insert as well as Update 1000,000 records to a table using JAVA JDBC ...


Go Back   Unix Technical Forum > Database Server Software > Informix

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 04:31 PM
djain13@gmail.com
 
Posts: n/a
Default Performance Tuning of batch insert and batch update using JDBC API.

Hi All,
I am trying to Insert as well as Update 1000,000 records to a
table using JAVA JDBC Batch Update API's .
Where my batch size is 10,000.

Informix 10.0 is taking approx 350-400 secs for insertin of 1000,000
records.
The same is taking 20-25 secs in DB2 9.

Wanna tune this.

Following is the table structure:

CREATE TABLE ELEPCIS.SERIAL_ID (
RESOURCE_ID INTEGER NOT NULL ,
SERIAL_ID INT8 NOT NULL ,
STATUS INTEGER DEFAULT 0,
REQUEST_ID INTEGER DEFAULT 1) ;

ALTER TABLE ELEPCIS.SERIAL_ID
ADD CONSTRAINT PRIMARY KEY
(RESOURCE_ID,
SERIAL_ID) CONSTRAINT CC119033234;

ALTER TABLE ELEPCIS.SERIAL_ID
ADD CONSTRAINT FOREIGN KEY
(REQUEST_ID)
REFERENCES ELEPCIS.REQUEST
(REQUEST_ID) CONSTRAINT CC11800424368;


Thanks
Dj
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2008, 04:31 PM
Marco Greco
 
Posts: n/a
Default Re: Performance Tuning of batch insert and batch update using JDBCAPI.

djain13@gmail.com wrote:
> Hi All,
> I am trying to Insert as well as Update 1000,000 records to a
> table using JAVA JDBC Batch Update API's .
> Where my batch size is 10,000.
>
> Informix 10.0 is taking approx 350-400 secs for insertin of 1000,000
> records.
> The same is taking 20-25 secs in DB2 9.
>
> Wanna tune this.
>
> Following is the table structure:
>
> CREATE TABLE ELEPCIS.SERIAL_ID (
> RESOURCE_ID INTEGER NOT NULL ,
> SERIAL_ID INT8 NOT NULL ,
> STATUS INTEGER DEFAULT 0,
> REQUEST_ID INTEGER DEFAULT 1) ;
>
> ALTER TABLE ELEPCIS.SERIAL_ID
> ADD CONSTRAINT PRIMARY KEY
> (RESOURCE_ID,
> SERIAL_ID) CONSTRAINT CC119033234;
>
> ALTER TABLE ELEPCIS.SERIAL_ID
> ADD CONSTRAINT FOREIGN KEY
> (REQUEST_ID)
> REFERENCES ELEPCIS.REQUEST
> (REQUEST_ID) CONSTRAINT CC11800424368;
>
>
> Thanks
> Dj
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>


well, there are a great many things you don't say. for instance do you alter
the table and add the constraints after the inserts, or before? the latter
would severely impact performance.
what are the extent sizes?
do you use insert cursors (can you in java?)?
are you using statement cache?
are you repreparing the statement every time?
is your jdbc client connecting from a remote client? maybe you need some
communications layer tuning?
is there anything else going on on this instance? on this box?
are the IDS and DB2 instances and boxes comparable?

in short, this might help you:

http://www.catb.org/~esr/faqs/smart-questions.html

--
Ciao,
Marco
__________________________________________________ ____________________________
Marco Greco /UK /IBM Standard disclaimers apply!

Structured Query Scripting Language http://www.4glworks.com/sqsl.htm
4glworks http://www.4glworks.com
Informix on Linux http://www.4glworks.com/ifmxlinux.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-20-2008, 04:31 PM
Sebastian, Norma J.
 
Posts: n/a
Default RE: Performance Tuning of batch insert and batch update using JDBCAPI.

In addition to Marco's comments, how exactly are you doing the DB2 9
load?... Is it truly an insert or is it a "load" operation that is "not
logged"?.... Bypassing transaction logging can surely save time.
================================================== ==========
The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader
of this message is not the intended recipient, or an employee
or agent responsible for delivering this message to the
intended recipient, you are hereby notified that any reproduction,
dissemination or distribution of this communication is strictly
prohibited. If you have received this communication in error,
please notify us immediately by replying to the message and
deleting it from your computer. Thank you. Tellabs
================================================== ==========
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-20-2008, 04:31 PM
Ian Michael Gumby
 
Posts: n/a
Default RE: Performance Tuning of batch insert and batch update using JDBCAPI.


I think Marco hit the nail on the head.

If you have the same table structure, same java application...
your only differences are on the layout and tuning of the engine, and the jdbc driver. (Unless you're using DRDA....)

The differences in the JDBC driver wouldn't cause this big of a time difference.

So that leave your tuning of the engine....
> Date: Mon, 24 Dec 2007 07:54:08 +0000> From: marco@4glworks.com> To: djain13@gmail.com; informix-list@iiug.org> Subject: Re: Performance Tuning of batch insert and batch update using JDBC API.> > djain13@gmail.com wrote:> >Hi All,> > I am trying to Insert as well as Update 1000,000 records to a> > table using JAVA JDBC Batch Update API's .> > Where my batch size is 10,000.> > > > Informix 10.0 is taking approx 350-400 secs for insertin of 1000,000> > records.> > The same is taking 20-25 secs in DB2 9.> > > > Wanna tune this.> > > > Following is the table structure:> > > > CREATE TABLE ELEPCIS.SERIAL_ID (> > RESOURCE_ID INTEGER NOT NULL ,> > SERIAL_ID INT8 NOT NULL,> > STATUS INTEGER DEFAULT 0,> > REQUEST_ID INTEGER DEFAULT 1) ;> > > > ALTER TABLE ELEPCIS.SERIAL_ID> > ADD CONSTRAINT PRIMARY KEY> > (RESOURCE_ID,> > SERIAL_ID) CONSTRAINT CC119033234;> > > > ALTER TABLE ELEPCIS.SERIAL_ID> > ADD CONSTRAINT FOREIGN KEY> > (REQUEST_ID)> > REFERENCES ELEPCIS.REQUEST> > (REQUEST_ID) CONSTRAINT CC11800424368;> > > > > > Thanks> > Dj> > _______________________________________________> > Informix-list mailing list> > Informix-list@iiug.org> > http://www.iiug.org/mailman/listinfo/informix-list> > > > well, there are a great many things you don't say. for instance do you alter> the table and add the constraints after the inserts, or before? the latter> would severely impact performance.> what are the extent sizes?> do you use insert cursors (can you in java?)?> are you using statement cache?> are you repreparing the statement every time?> is your jdbc client connecting from a remote client? maybe you need some> communications layer tuning?> is there anything else going on on this instance? on this box?> are the IDS and DB2 instances and boxes comparable?> > in short, this might help you:> > http://www.catb.org/~esr/faqs/smart-questions.html> > -- > Ciao,> Marco> __________________________________________________ ____________________________> Marco Greco /UK /IBM Standard disclaimers apply!> > Structured Query Scripting Language http://www.4glworks.com/sqsl.htm> 4glworks http://www.4glworks.com> Informix on Linux http://www.4glworks.com/ifmxlinux.htm> _______________________________________________> Informix-list mailing list> Informix-list@iiug.org> http://www.iiug.org/mailman/listinfo/informix-list

__________________________________________________ _______________
Don't get caught with egg on your face. Play Chicktionary!
http://club.live.com/chicktionary.as...mtextlink1_dec
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:18 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com