Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / March 2005

Tip: Looking for answers? Try searching our database.

update taking forever

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christos Kalantzis - 17 Mar 2005 15:29 GMT
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
Mark A - 17 Mar 2005 17:07 GMT
> Hello Gentlemen,
>
[quoted text clipped - 32 lines]
>
> 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.
db2dba@gmail.com - 18 Mar 2005 22:43 GMT
:Hello Gentlemen,
:
[quoted text clipped - 32 lines]
:
: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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.