Update table instantly or “Bulk” Update in database later? And is it advisable?

Posted by Mestika on Stack Overflow See other posts from Stack Overflow or by Mestika
Published on 2010-05-16T15:46:39Z Indexed on 2010/05/16 15:50 UTC
Read the original article Hit count: 155

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

© Stack Overflow or respective owner

Related posts about db2

Related posts about update