|
Hi, Any one please clarify my doubt, In one of the query I am retrieving data by joining the 5 tables but in that one of the table contains 4 millions records are soft deleted ( Is_deleted_ind = 'Y'), we should not consider the soft deleted records. So which one gives better performance to write a query OR and which one runs first where clause or join clause while running the query. Thanks in Advance.
(comments are locked)
|
|
Whilst the query is an inner join, then yes there is no difference. If the query was to be changed to an outer join, then it's a different story. Lets show an example So we can see that these 2 queries return the same 5 rows but changing to a outer join (where the The first query returns 7 rows as the but the second query returns 6 rows as the So what's the point of all this.... Code the query to be right. If
(comments are locked)
|
|
In this case, short answer is It will not matter. They would have the same execution plan and same throughput. The optimizer is smart enough to handle them as the same :) But I will prefer the WHERE clause for better readability.
(comments are locked)
|

