使用where子句有效地从巨大的表中选择顶行

时间:2016-05-17 16:40:59

标签: performance where-clause newid

在具有 2,00,000 记录的巨大 sql server 表中,考虑到性能视角,下面的查询是否正常。请提供您即兴发布此查询的建议。

INSERT INTO @Results (Name, URL, MSA)    
select top 10 Name, URL, MSA from NearByCity where NearByCityId in
(select NearByCityId from dbo.NearByCity where MSA like '%Atlanta-Sandy Springs-Roswell, GA Metropolitan Statistical Area%'  )   
order by newid()

0 个答案:

没有答案