473,387 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

update taking forever

Hello Gentlemen,

I have a table which is the highest level table in my DB
design...ie...all tables have foreign keys that if the chain is
followed, lead to this table.

This table had quite a few indexes (8) as well, however we have balanced
the issue of SELECT performance to INSERT performance and we have
internaly justified each indexe and removed some redundant ones.

Originaly my programmers would write UPDATE statments that updated all
the columns of the table, even though only 2 columns on that table could
ever have been affected by that code snipet. This update, because of
the load on that table, would take sometimes over a minute to complete,
if it didn't rollback because of a timeout.

My first step was to have them rewrite their code to only update the 2
columns that could ever change in that snipet of code. My logic behind
that was because some other columns, even though they didn't change,
would force the indexes to update themselves, causing a longer transaction.

None of the 2 columns left in the update are referenced by FKs, so I
assumed there is no need for an integrity check, all the way down the
pipeline.

However, its this assuption I am questioning. When DB2 UDB 7.2 (NO
fixpak....so 7.1 FP3) does an update.....in the background, is it doing
a "phantom" DELETE/INSERT which is forcing a check of the integrity of
all the FKs underneath it? Or is it doing just an UPDATE on the columns
specified in the command?

Any ideas?

Thank you in advance

Christos Kalantzis
Nov 12 '05 #1
2 1547
"Christos Kalantzis" <ch*******@intertrade.com> wrote in message
news:Evg_d.51210$KI2.6064@clgrps12...
Hello Gentlemen,

I have a table which is the highest level table in my DB
design...ie...all tables have foreign keys that if the chain is
followed, lead to this table.

This table had quite a few indexes (8) as well, however we have balanced
the issue of SELECT performance to INSERT performance and we have
internaly justified each indexe and removed some redundant ones.

Originaly my programmers would write UPDATE statments that updated all
the columns of the table, even though only 2 columns on that table could
ever have been affected by that code snipet. This update, because of
the load on that table, would take sometimes over a minute to complete,
if it didn't rollback because of a timeout.

My first step was to have them rewrite their code to only update the 2
columns that could ever change in that snipet of code. My logic behind
that was because some other columns, even though they didn't change,
would force the indexes to update themselves, causing a longer transaction.
None of the 2 columns left in the update are referenced by FKs, so I
assumed there is no need for an integrity check, all the way down the
pipeline.

However, its this assuption I am questioning. When DB2 UDB 7.2 (NO
fixpak....so 7.1 FP3) does an update.....in the background, is it doing
a "phantom" DELETE/INSERT which is forcing a check of the integrity of
all the FKs underneath it? Or is it doing just an UPDATE on the columns
specified in the command?

Any ideas?

Thank you in advance

Christos Kalantzis


DB2 is only updating the columns. However, if the columns are varchar, and
the column is now larger, the row may not fit back in the same space, or may
not fit on same page, so DB2 has to put the row somewhere else (without
getting into details).

Also , if an index column is updated, the DB2 does have to delete the old
index value and insert a new one. If there is no space on the correct index
page for the new value, then a page split may occur. There could be a lot of
extra steps involved.

You should definitely move to the latest fixpak. I don't know if your
problems are related to any APARs that have fixed with later fixpaks, but
that is always a possibility.
Nov 12 '05 #2
On Thu, 17 Mar 2005 14:29:56 GMT, Christos Kalantzis <ch*******@intertrade.com>
wrote:

:Hello Gentlemen,
:
:I have a table which is the highest level table in my DB
:design...ie...all tables have foreign keys that if the chain is
:followed, lead to this table.
:
:This table had quite a few indexes (8) as well, however we have balanced
:the issue of SELECT performance to INSERT performance and we have
:internaly justified each indexe and removed some redundant ones.
:
:Originaly my programmers would write UPDATE statments that updated all
:the columns of the table, even though only 2 columns on that table could
:ever have been affected by that code snipet. This update, because of
:the load on that table, would take sometimes over a minute to complete,
:if it didn't rollback because of a timeout.
:
:My first step was to have them rewrite their code to only update the 2
:columns that could ever change in that snipet of code. My logic behind
:that was because some other columns, even though they didn't change,
:would force the indexes to update themselves, causing a longer transaction.
:
:None of the 2 columns left in the update are referenced by FKs, so I
:assumed there is no need for an integrity check, all the way down the
:pipeline.
:
:However, its this assuption I am questioning. When DB2 UDB 7.2 (NO
:fixpak....so 7.1 FP3) does an update.....in the background, is it doing
:a "phantom" DELETE/INSERT which is forcing a check of the integrity of
:all the FKs underneath it? Or is it doing just an UPDATE on the columns
:specified in the command?
:
:Any ideas?
:
:Thank you in advance
:
:Christos Kalantzis

You might want to post this q on the db2 email user's group list. Lots of
experience and ideas there - see www.herethey.com or
http://www2.herethey.com:8888/mailman/listinfo/db2eug to subscribe.

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: David Berman | last post by:
I'm having a problem with an update operation in a stored procedure. It runs so slowly that it is unusable, unless I comment a part out in which case it is very fast. However, I need the whole...
3
by: Dan Berlin | last post by:
I have two tables: T1 : Key as bigint, Data as char(20) - size: 61M records T2 : Key as bigint, Data as char(20) - size: 5M records T2 is the smaller, with 5 million records. They both have...
8
by: paulwilliamsonremove | last post by:
Hi, Using Access 2003. I am trying to delete records from one table/query ("qryHistoryPersonIDs") if they don't exist in another table ("qryDonations"). But the SQL syntax I came up with is...
0
by: John Bailo | last post by:
Has anyone downloaded the DirectX SDK...it's taking me forever! I want to do some GDI programming in c# using VC#Express
3
by: John Cosmas | last post by:
I have a DATATABLE which I have populated in my application, and I need it written out to a particular table I specify in my ACCESS database. My code works to the point of the MERGE and UPDATE,...
1
by: Dmitri | last post by:
Hi! I have a stored procedure that takes 22 minutes to run in one environment, that only takes 1 sec or so to run in another environment. Here is the exact situation: Database 1 on Server 1...
2
by: Martin Eckart | last post by:
Hello, I have built a Hello World Web Service using Visual Studio 2005 and .NET 2.0 on machine A. Setting up a Web Site on machine B and adding a web reference to that WS works fine, without any...
0
Logan1337
by: Logan1337 | last post by:
Hi. I'm using SQL Server Compact Edition with Ado.net and have a serious performace issue I'd like to clear up. The problem in it's simplest form is that I load say 2,000 rows from a table in the...
13
by: Neil | last post by:
I'm running an update query in SQL 7 from QA, and it runs forever. Has been running for 20 minutes so far! The query is quite simple: update a single field in a table, based on a join with another...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.