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

WordPress Trac wp-trac at lists.automattic.com
Sat Apr 12 23:48:40 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.7      
Component:  Optimization  |      Version:  2.5      
 Severity:  major         |   Resolution:           
 Keywords:                |  
--------------------------+-------------------------------------------------
Changes (by DD32):

  * priority:  highest omg bbq => high

Comment:

 What theme are you using?

 What widgets do you have loaded?

 I just tried with /about-me/sub-about-me/sub-sub-about-me/ and i have 5
 page-related queries:
 {{{
       4 =>
         array
           0 => string 'SELECT ID, post_name, post_parent FROM wp_posts
 WHERE post_name = 'sub-sub-about-me' AND (post_type = 'page' OR post_type
 = 'attachment')' (length=137)
           1 => float 0.000761032104492
           2 => string 'get_page_by_path' (length=16)
       5 =>
         array
           0 => string 'SELECT ID, post_name, post_parent FROM wp_posts
 WHERE ID = 74 and post_type='page'' (length=82)
           1 => float 0.000460863113403
           2 => string 'get_page_by_path' (length=16)
       6 =>
         array
           0 => string 'SELECT ID, post_name, post_parent FROM wp_posts
 WHERE ID = 7 and post_type='page'' (length=81)
           1 => float 0.000438928604126
           2 => string 'get_page_by_path' (length=16)
       7 =>
         array
           0 => string 'SELECT * FROM wp_posts WHERE ID = 75 LIMIT 1'
 (length=44)
           1 => float 0.000741004943848
           2 => string 'get_post' (length=8)
       8 =>
         array
           0 => string ' SELECT   wp_posts.* FROM wp_posts  WHERE 1=1  AND
 (ID = '75') AND wp_posts.post_type = 'page'  ORDER BY wp_posts.post_date
 DESC ' (length=129)
           1 => float 0.000733137130737
           2 => string 'get_posts' (length=9)
 }}}
 (I'm not sure why both get_post() and get_posts() are making pretty
 similar queries

 It'd be helpful to know where the queries are coming from. As you can see
 in that example, mine mainly come from 'get_page_by_path()'

 while there's probably another plugin out there which probably allready
 does this, i'll attach a plugin which dumps the queries made into the
 footer of the page as a HTML comment, so you'll need to view the HTML
 source to get at them, Hopefully that'll include the source of the queries
 (I'm not too sure what the plugin you used is/does)

 You'll also need to add
 {{{
 define('SAVEQUERIES', true);
 }}}
 to your wp-config.php file.

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


More information about the wp-trac mailing list