Hi everybody,
I have a performance issue question for you.
I’ve got two tables TBL_ONE and TBL_TWO with primary key field on first table
PR_KEY and foreign key field on second table FRGN_KEY. I would like to get
some result data set from two tables, what should I use for better performance:
“SELECT * from TBL_ONE INNER JOIN TBL_TWO ON PR_KEY=FRGN_KEY
WHERE SOME_FIELD=’some_value’”
or
“SELECT * FROM TBL_ONE, TBL_TWO WHERE PR_KEY=FRNG_KEY AND
SOME_FIELD=’some_value’”.
And I guess there are two general questions here, first – is JOIN faster
then WHERE clause, second – what is processed first on SQL Server WHERE clause
or JOIN part of SQL statement(meaning when JOIN is used, does SQL Server
joins tables first and then selects rows according the WHERE clause or first
does WHERE and then tries to join result sets).
Any input would be greatly appreciated.
igor