update时order by的问题

对一张10w条记录的标进行update,1000条记录提交一次。
在这期间需要对该表做一个select * from table order by xx的操作
但是好像在update完成之前不会返回结果。

请问是不是update的时候order by是要等待前面锁的释放的阿?

如果想要在update的时候完成这个Order by操作,应该怎么做?
谢谢

数据库的隔离级别是默认的隔离级别,游标级的

回答:

if it's CS, when the query get to the rows that being locked by the update transaction, it will wait until the lock is released....
then in this case, you should use isolation level = UR to do it
select * from table order by xx with UR

猜你喜欢

转载自wmcxy.iteye.com/blog/2055567