-
INNER JOIN vs WHERE
Hi,
I need to filter out records from a query that select items from 6-7 tables (using union all).
All these tables has a field of transaction guid.
I also have a Transactions table with all tran. guids.
The question is what better to do:
Use an INER JOIN 6-7 times on each item table
or
Add "WHERE itemTransactionGuid in (select trnGuid from Transactions)" on each item table
The query is part of a report's SP so performance is important.
Any help will be appriciated.
Thanks!!
-
I would use JOIN rather than WHERE clause. You can have additional filtering in WHERE clause.
-
The most important is an SQL execution plan, which generates by database engine, so it's more important pay attention on existing and used indexes for a fileds used for table joins.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|