[wp-hackers] LEFT JOIN in 2.7 to JOIN in 2.8; Why?

Austin Matzko if.website at gmail.com
Wed Jun 17 02:24:53 GMT 2009


On Tue, Jun 16, 2009 at 8:33 PM, Mike Schinkel
<mikeschinkel at newclarity.net> wrote:
> Does anyone know why the change was made in 2.8 on line 2141 of /wp-includes/query.php to this:

According to this ticket, it was done for better performance:
http://core.trac.wordpress.org/ticket/9720

> 2.) If no good reason can it be changed back? Testing for "LEFT JOIN ..." is more exact than testing or "JOIN ..."; or example there is a tiny chance I could match a "RIGHT JOIN ... " when I didn't intend to but not if I'm testing explicitly for "LEFT JOIN ..."

You could use a negative lookbehind, which will match "LEFT JOIN" and
"JOIN", but not "RIGHT JOIN":

preg_match('/(?<!RIGHT )JOIN/', $text)


More information about the wp-hackers mailing list