Sqlserver自动优化

 (1)select a.* from tb1 a left join tb2  b on a.id=b.id where a.name='1'


(2)select * from (select a.* from  tb1 a left join tb2 b on a.id=b.id) as d where name='1'


(3)建视图tbView :select a.* from  tb1 a left join tb2 b on a.id=b.id

select * from tbView as d where name='1'

这三种写法执行效率一模一样,印象中应该第一种写法最快。 
posted @ 2018-07-16 11:35  zhaogaojian  阅读(367)  评论(0编辑  收藏  举报