DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: How Much effect to add for update clause

  1. #1
    Join Date
    Aug 2000
    Location
    Shanghai
    Posts
    433

    How Much effect to add for update clause

    1. select * from t1 where ...
    2. select * from t1 where ... for update nowait

    I can not see any performance difference between these 2 sql .
    But I think there should be some difference because the explain plan shows me the addition optimize step for 'for update '
    1. www.dbasupport.com
    2. www.dbforums.com
    3. www.itpub.net
    4. www.csdn.net
    5. www.umlchina.com
    6. www.tek-tips.com
    7. www.cnforyou.com
    8. fm365.federal.com.cn
    9. www.programmersheaven.com
    10.http://msdn.microsoft.com/library/default.asp
    ligang1000@hotmail.com

  2. #2
    Join Date
    Jan 2000
    Location
    Chester, England.
    Posts
    818
    the performance overhead (if any) is immaterial/academic. Its what you are trying to do that's important. If you are just selecting and not updating then use #1. If you intend to update the row(s) selected then use # 2 (For Update), otherwise you cannot guarantee that the rows selected have not been updated in the time between you issuing the SELECT and the UPDATE.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width