今天查询数据,发现嵌套比临时表慢很多,形式大概就是下面显示的样子
代码一:
select *
from (select *
from table
)a
where a=1
代码二:
select * into #table
from table
select *
from #table
where a=1
代码二一秒就出来了,代码一转了十几分钟还出不来,是什么原因
...全文
2416打赏收藏
嵌套比临时表慢很多,什么原因
今天查询数据,发现嵌套比临时表慢很多,形式大概就是下面显示的样子 代码一: select * from (select * from table )a where a=1 代码二: select * into #table from table select * from #table where a=1 代码二一秒就出来了,代码一转了十几分钟还出不来,是什么原因