[wp-trac] [WordPress Trac] #25787: wp_page_menu function is very inefficient

WordPress Trac noreply at wordpress.org
Thu Oct 31 13:28:12 UTC 2013


#25787: wp_page_menu function is very inefficient
-------------------------+-------------------------------------------------
 Reporter:  whawker      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Menus        |    Version:  3.7.1
 Severity:  major        |   Keywords:  2nd-opinion needs-patch dev-
                         |  feedback
-------------------------+-------------------------------------------------
 I use wp_page_menu() to build my site's primary menu.

 The MySQL query this creates, selects all the columns from the wp_posts
 table.

 One of these columns is '''post_content'''. This means that when I create
 a menu, I am pulling massive amounts of data (the body text) from the DB
 which I will never (or very unlikely to) use. This adds a massive overhead
 which is killing my bandwidth.

 Through my own investigations I have found that a menu can be built using
 only these columns from wp_posts

 {{{
 ID, menu_order, post_title, post_name, post_parent, post_type
 }}}

 This is much more efficient, but I do not feel I know the WordPress code
 base well enough to contribute to the core.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25787>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list