View previous topic :: View next topic
|
Author |
Message |
Shubhradeep
New User
Joined: 14 Jan 2010 Posts: 4 Location: USA
|
|
|
|
Hi,
I searched for a similar post but cant find one. Can anyone tell me how to find out the number of rows in a DB2 page. Also, is there any way of knowing what exactly are the contents of a page, given the exact page number? Any help would be appreciated much.
Thanks,
Shub |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
If you explain how this might be used, someone may be able to profide a usable reply.
Why are you interested in how many rows are on some specific page? |
|
Back to top |
|
|
Shubhradeep
New User
Joined: 14 Jan 2010 Posts: 4 Location: USA
|
|
|
|
Hey,
Actually I am researching on a issue where we are having deadlocks in Db2 tables. We are getting the page number, but not the contents of that page to see on which record(or records) we should be focusing on. I was wondering if decreasing the number of rows in a page might solve our problem of deadlocks
Thanks,
Shub |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If there really are deadlocks (rather than timeouts), the problem is because of the design of the code in the problem update modules. The sequence of locking would cause deadlock problems.
Your system probably uses page-level locking. Many do. . .
If the problem is a timeout rather than a deadlock and you switch to row level locking, this may be reduced/prevented.
In an older release of db2, i had a group force only 1 row on a page because of the timeout problems encountered because row-level locking was not then implemented. |
|
Back to top |
|
|
Shubhradeep
New User
Joined: 14 Jan 2010 Posts: 4 Location: USA
|
|
|
|
Hi,
The problem is deadlock and not timeout. We are having multiple transactions trying to process same page simultaneously causing the issue. Row level locking will be a overhead considering the number of records. If you can let me know how to determine the number of rows in a page, I would like to see if reducing that minimizes the deadlocks.
Thanks,
Shub |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
To repeat, deadlocks are almost always due to poor/inconsistent design of the update code |
d.sch.,
by now you should realize that the fools that created the crap code do not want to hear that.
they want a solution to the problem other than fixing the problem
sorta along the lines of Mac's motto:
could not fix the brakes, so I made your horn louder. |
|
Back to top |
|
|
Shubhradeep
New User
Joined: 14 Jan 2010 Posts: 4 Location: USA
|
|
|
|
Hi D.Sch,
Thanks for the link. I knew the max numbers of rows in a page. The approximation guide was helpful for me.
D.Br,
Thank you too for your encouraging words. Probably in a real world where u need to meet deadlines every next day, sometimes making the horn louder instead of changing millions of lines of 'crapy' code helps!!
Thanks,
Shub |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
yeah yeah, yeah,
everyone has an excuse. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
. . .do not want to hear that.
they want a solution to the problem other than fixing the problem |
Yup, and usually, there is no magic bullet that will "solve" it. . .
Quote: |
Probably in a real world where u need to meet deadlines every next day, sometimes making the horn louder instead of changing millions of lines of 'crapy' code helps!! |
I've been several places that tell me "You don't understand why we have to do this in a bad way". The only real reason they "had" to do bad things is because they were unaware of any other way to proceed. . . When shown a "good" way, they are often pleasantly surprised to see that doing it "right" goes faster and is more error free than the kludge that was in process. It is faster/easier to implement properly than to just "throw things together" - but this implies there is proper project leadership and a basic understanding of certain things "not to do".
If you isloate the processes that cause the deadlock most often and correct them, it will probably provide the most relief most quickly. Over time, the others can be reviewed/corrected. |
|
Back to top |
|
|
Manshadi
New User
Joined: 31 Aug 2005 Posts: 82
|
|
|
|
Hi,
If you have the page number you can use DSN1PRNT for finding number of record on the page.
Thanks
Manshadi |
|
Back to top |
|
|
|