[wp-trac] [WordPress Trac] #3373: Better get_page_uri
WordPress Trac
wp-trac at lists.automattic.com
Sun Nov 19 14:13:30 GMT 2006
#3373: Better get_page_uri
-----------------------------+----------------------------------------------
Reporter: ryanscheuermann | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.1
Component: Optimization | Version: 2.1
Severity: normal | Keywords: get_page_uri
-----------------------------+----------------------------------------------
Upon testing the queries on some of my sites, I found that there were a
LOT more queries for pages that were deeper/farther down in the page
hierarchy. I am using get_page_link to get the link for pages on the
navigation. This function calls get_page_uri which in turn calls get_page
over and over until it builds the tree. When you call get_page, you run a
SELECT * FROM wp_posts query. List all your pages, and you've now SELECT
*'d every single page.
I've attached a patch that builds the hierarchy from 1 query instead of
multiple.
--
Ticket URL: <http://trac.wordpress.org/ticket/3373>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list