[wp-trac] Re: [WordPress Trac] #6702: Raise in the Wordpress number of queries in nested pages

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 14 10:42:32 GMT 2008


#6702: Raise in the Wordpress number of queries in nested pages
-------------------------------------+--------------------------------------
 Reporter:  tiosolid                 |        Owner:  anonymous
     Type:  defect                   |       Status:  new      
 Priority:  high                     |    Milestone:  2.6      
Component:  Optimization             |      Version:  2.5      
 Severity:  major                    |   Resolution:           
 Keywords:  has-patch needs-testing  |  
-------------------------------------+--------------------------------------
Changes (by DD32):

  * keywords:  => has-patch needs-testing
  * milestone:  2.7 => 2.6

Comment:

 Replying to [comment:4 tiosolid]:
 > On the other pages where the error occours the problematic function is
 the same (_get_post_ancestors)

 To me it looks like theres a logic error:[[BR]]
 http://trac.wordpress.org/browser/trunk/wp-includes/post.php#L2968
 {{{
         if ( !isset($_post->ancestors) )
                 return;
 }}}
 While that seems to say do not load ancestors if none are allready set to
 me, However, I'm not sure if thats quite correct in general.

 Eitherway, The attached patch prevents those multiple queries for me, It
 limits it to finding the ancestors once per page request, I thought of
 wrapping it in a wp_cache_get/set however, this seems to do the job.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6702#comment:5>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list