Opened 20 years ago
Closed 18 years ago
#3373 closed enhancement (invalid)
Better get_page_uri
| Reported by: | ryanscheuermann | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Optimization | Version: | 2.0.5 |
| Severity: | normal | Keywords: | get_page_uri has-patch needs-test |
| Cc: | Focuses: |
Description
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.
Attachments (2)
Change History (8)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This ticket could also be modified and applied to 2.0.6. I've attached that patch also.