select dbid,name,segmap from sysusages,sysdevices where sysdevices.low<=syusages.size+vstart and sysdevices.high>=sysusages.size+vstart-1 and dbid=2 and(status=2 or status=3)
create proc base_proc as select * into #huge_result from auths select * from article, #huge_result where article.author_code= #huge_result.author_code and sex=”0”
使用两个过程可以得到更好的性能
1)create proc base_proc
as select * into #huge_result from auths exec select_proc
2) create proc select_proc
as select * from article,#huge_result where article.author_code=#huge_result.author_code and sex=”0”