List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:March 21 2006 9:01am
Subject:Re: RIGHT JOIN better than INNER JOIN?
View as plain text  


> I apologize if this is a naive question but it appears through my
> testing that a RIGHT JOIN may out perform an INNER JOIN in those cases
> where they would produce identical result sets. i.e. there are no keys
> in the left table that do not exist in the right table. 
> 
> Is this true? If so, it this peculiar to MySQL or would this be true
> with almost all database servers? i.e. Oracle, DB2, MSSQL, etc.

Use the join that is appropriate for your query, do not use a
different one.

If speed isn't OK, then bug the guys that do the implementation,
but don't start changing the query that _might_ return a different
result if, for example, someone else starts working at the application
and figures "hey, this is a right join, so it's optional" etc ...

Martijn Tonies
Database Workbench - development tool for MySQL, and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
Thread
RIGHT JOIN better than INNER JOIN?Robert DiFalco21 Mar
  • Re: RIGHT JOIN better than INNER JOIN?Rhino21 Mar
  • Re: RIGHT JOIN better than INNER JOIN?Jochem van Dieten21 Mar
  • Re: RIGHT JOIN better than INNER JOIN?Martijn Tonies21 Mar
  • Re: RIGHT JOIN better than INNER JOIN?Rhino21 Mar
  • RE: RIGHT JOIN better than INNER JOIN?Nicolas Verhaeghe21 Mar
RE: RIGHT JOIN better than INNER JOIN?Robert DiFalco21 Mar
  • Re: RIGHT JOIN better than INNER JOIN?Martijn Tonies21 Mar
RE: RIGHT JOIN better than INNER JOIN?Robert DiFalco21 Mar
  • Re: RIGHT JOIN better than INNER JOIN?gerald_clark21 Mar
  • Re: RIGHT JOIN better than INNER JOIN?Rhino21 Mar