Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Can an extra WHERE clause accelerate an INNER JOIN?

$
0
0

I already get the correct result (let's say 10 rows) with the bare-minimum where clause, on my INNER JOIN.

The two tables are called Files and Accounts.  However, I already know in advance that those 10 rows will be of file type '835' - I just haven't made this point explicit in the where clause.  So I could add the following to my existing WHERE clause.

Select * from Accounts

INNER JOIN Files ON...

WHERE..... AND Files.FileType = '835'

Assuming all columns are indexed in both tables, would this extra criteria tend to increase performance, degrade it, or have no effect?

(The Files table has 1/2 million records. The Accounts table has 10 million records).


Viewing all articles
Browse latest Browse all 7129

Trending Articles