Arun Kumar MG
Arun Kumar MG

Reputation: 158

Which One is better With Join Keyword or Without Join Keyword for this query

I have md_members table with more than 15,00,000 rows... To get performance which is better -join query with join keyword/without join keyword ....

Select 
     mem_fname
    ,mem_lname
    ,mem_mobile
    ,mem_email
    ,wda_first_login
    ,a.updated_on as wda_last_login 
From wda_article_log as a,md_members as b 
where b.mem_id=a.mem_id and a.article_type=1 and b.wda_status=1`

Upvotes: 2

Views: 206

Answers (1)

Shadow
Shadow

Reputation: 34285

The explicit inner join and the comma syntax are equivalent in terms of performance. You can check the output of explain for both versions, they will yield the same query plan.

There is a difference in the precedence of these operators, so if you mix them, you may have some nasty surprises, but in the query in the question this is not the case.

The reason for using an explicit inner join over an implicit one is that the code is better readable because the join conditions and the filtering criteria are separated from each other.

Upvotes: 3

Related Questions