By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,333 Members | 1,226 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,333 IT Pros & Developers. It's quick & easy.

locks and related

P: n/a
Hello,

My question is a follow up on a recent thread (db2_evaluncommitted)

If I have a table with say a million rows and a predicate of my update
clause matches say 8000 records,
does db2 only lock 8000 records or does it lock records that it evaluates
based on the query plan.
(db2_evaluncommitted=yes, isolation level --> cursor stability

I see locks in the order of 30,000 - 50,000 if there were no statistics
collected on the transaction table

once I executed the run stats, the locks were pretty close to around 8500.
(which is what I expect)

I was assuming only rows that match the predicate will be locked
irrespective of a runstats but i dont see it
that way based on my above observation? can anyone explain me how the
locking mechanism works?
Thanks,
Sumanth

Apr 4 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Do an explain on the current query. Remove the statistics you added and
redo the explain. If you have different access plans, they you may be
able to account for the difference in locks.

Phil Sherman

Sumanth wrote:
Hello,

My question is a follow up on a recent thread (db2_evaluncommitted)

If I have a table with say a million rows and a predicate of my update
clause matches say 8000 records,
does db2 only lock 8000 records or does it lock records that it evaluates
based on the query plan.
(db2_evaluncommitted=yes, isolation level --> cursor stability

I see locks in the order of 30,000 - 50,000 if there were no statistics
collected on the transaction table

once I executed the run stats, the locks were pretty close to around 8500.
(which is what I expect)

I was assuming only rows that match the predicate will be locked
irrespective of a runstats but i dont see it
that way based on my above observation? can anyone explain me how the
locking mechanism works?
Thanks,
Sumanth

Apr 5 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.