If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Update table instantly or “Bulk” Update in database later? And is it advisable?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-16-10, 12:38
Mestika Mestika is offline
Registered User
 
Join Date: Apr 2010
Posts: 5
Question Update table instantly or “Bulk” Update in database later? And is it advisable?

Hi,

I have a question regarding a semi-constant update in a database. In short it is regarding a checkout function on a web page, which each time the checkout function is evoked it do five steps.

I want to try to optimize this function and have my eye on a step where I update a table each time the checkout is performed. I take the information retrieved from the shopping cart and then update the table in question.

I do have some indexes on the table, the gain from those are greater than leaving them so this is a cost I’m willing to take.

Now, my question is. Could it in some way regarding to performance be better to not update the table instantly but collect every checkout items and save them in some way (maybe in a file) and then at a specific time (or several times) at day take this file and then update the table with the new information.

Then I started thinking about if there was a possibility to use some sort of Bulk Update to take a file, hashmap, array (or?) and then update it.

And I’m using IBM DB2 version 9.7

- Mestika
Reply With Quote
  #2 (permalink)  
Old 05-16-10, 14:06
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,007
DB2 can usually handle over a thousand inserts/updates per second (assuming there is no lock contention), even on a dual core system. I would not look at bulk processing unless you have millions of rows to process at one time.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 05-16-10, 14:29
Mestika Mestika is offline
Registered User
 
Join Date: Apr 2010
Posts: 5
Hi Marcus,

thank you for your answer.

You maybe right, the performance gain would be negligible and might nonexistent. I will try to increase performance in another way and leave the updates and insertions alone.
Reply With Quote
Reply

Tags
bulk, db2, db2 9.7, optimize, update

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On