What's blocking “Select top 1 * from TableName with (nolock)” from returning a result?

前端 未结 4 1800
余生分开走
余生分开走 2021-02-20 14:37

I\'m currently running the following statement

select * into adhoc..san_savedi from dps_san..savedi_record

It\'s taking a painfully long time a

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-20 14:54

    It very well may be that there are no locks... If dps_san..savedi_record is a view, then it may be taking a long time to execute, because it may be accessing tables without using an index, or it may be sorting millions of records, or whatever reason. Then your query, even a simple top or count, will be only as fast as that view can be executed.

提交回复
热议问题