TERADATA LOCK LEVELS

Database
Enthusiast

TERADATA LOCK LEVELS

Hi All,

While studying for Teradata lock, I became a bit confused regarding level of locking. Instead of givingh specific examples I will directly ask my query here. From DML, how optimiser decides it is a table level lock or row hash level? I mean just if I look into my SQL, how do I understand which level of lock is going to be placed?

AND

If I specify "LOCK TABLE EMP FOR READ" and then if I write a query with UPI in where clause, will my user chosen table level lock be downgraded to hash level?

Vice versa i.e. "LOCK ROW FOR WRITE", then query says about a UPDATE TAB SET FIELD= ... there is no where condition. Will my row level lock be upgraded to a table level by optimiser?

3 REPLIES
Enthusiast

Re: TERADATA LOCK LEVELS

Hi, can anybody please clarify my above query?

Enthusiast

Re: TERADATA LOCK LEVELS

Hi,

You can consult the following document and you will get all the answers to your query:

http://www.info.teradata.com/htmlpubs/DB_TTU_14_00/index.html#page/General_Reference/B035_1091_111A/...

Also, yes the optimizer has the capbility to upgrade downgrade locks depending upon the requirement.

Khurram
Enthusiast

Re: TERADATA LOCK LEVELS

Thanks Saeed. I went through the page and it clarified me.