Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
BorisCallens
Yak Posting Veteran
50 Posts |
Posted - 2008-08-01 : 09:50:47
|
select count(distinct v.colorId) as totalCountfrom searchView v=> 5+ secondsselect count(t.kawnt) as totalCountfrom (select distinct v.colorId as kawnt from searchView v) as t=> 1secondselect distinct v.colorIdfrom searchView v=> 1- secondsHowcom does the extra complexity from the second query result in a faster query? |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-01 : 13:14:06
|
have a had a look at query plans for first and second query? |
 |
|
|
|
|