Does anybody have any suggestions on how to improve the following statements:
insert into ProductInfo with (rowlock) (orderid, productname)
select 66673, FileInfoId
from ProductInfo with (nolock) where
Prod开发者_如何学CuctId = 66671 and
IsEligableForCopy = 1 and
ProductFileInfoId >= 2768395941 and
ProductFileInfoId < 2768405941
It sounds like it is timing out because it fails to obtain a lock. What DBMS are you using? And have you tried it without requesting a lock? The example you present appears to be a one-time insert, but I assume this is just an example, as opposed to something you would run in production.
Improve or add indicies on ProductInfo...maybe it won't timeout
The Query looks fine. It should be running perfectly. Is there anything specific that you want to achieve.?
精彩评论