Re: Query Performance

Tech-Archive recommends: Fix windows errors by optimizing your registry



Can you test it on your end?


--
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--


"Ash" <Ash@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:35B4DB69-229F-41F4-8232-339934FDC681@xxxxxxxxxxxxxxxx
> So which scenario would the join run faster (I'm talking about > 2,000,000
> records in each table)
>
> 1)ID is PK, F1 & F2 are unique and index
> table1 table2
> ID <IDENTITY> ID<IDENTIT>
> F1<CHAR(10)> F1<CHAR(10)>
> F2<CHAR(10)> F2<CHAR(10)>
> F3<CHAR(10)> F4<CHAR(10)>
> SELECT * FROM table1 t1,table2 t2 WHERE t1.ID=t2.ID AND t1.f1='Somthing'
AND
> t1.f2='Somthing Else'
>
> 2)F1 & F2 are PK and index
> table1 table2
> F1<CHAR(10)> F1<CHAR(10)>
> F2<CHAR(10)> F2<CHAR(10)>
> F3<CHAR(10)> F4<CHAR(10)>
> SELECT * FROM table1 t1,table2 t2 WHERE t1.f1=t2.f1 AND t1.f2=t2.f2 AND
> t1.f1='Somthing' AND t1.f2='Somthing Else'
>
> Thanks


.