[wp-trac] Re: [WordPress Trac] #9720: Why the left joins in wp-include/query.php?

WordPress Trac wp-trac at lists.automattic.com
Mon May 4 12:29:33 GMT 2009


#9720: Why the left joins in wp-include/query.php?
-------------------------------+--------------------------------------------
 Reporter:  Denis-de-Bernardy  |       Owner:  anonymous              
     Type:  defect (bug)       |      Status:  new                    
 Priority:  normal             |   Milestone:  2.8                    
Component:  Optimization       |     Version:  2.8                    
 Severity:  normal             |    Keywords:  has-patch needs-testing
-------------------------------+--------------------------------------------
Changes (by Denis-de-Bernardy):

  * keywords:  => has-patch needs-testing


Comment:

 Example:


 {{{
 SELECT foo.*
 FROM foo
 JOIN bar USING ( id )
 WHERE bar.col = 'val'

 -> uses the index on bar(col) // fast

 SELECT foo.*
 FROM foo
 LEFT JOIN bar USING ( id )
 WHERE bar.col = 'val'

 -> depending on how the query rewriter optimizes this (it could be
 rewritten as above), either the above plan or:
 hash join on shared key, filter on bar.col = 'val' // amounts to a seq
 scan in our case, so very slow

 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9720#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list