Ticket #3373 (new enhancement)

Opened 2 years ago

Last modified 8 months ago

Better get_page_uri

Reported by: ryanscheuermann Assigned to: anonymous
Priority: normal Milestone: 2.9
Component: Optimization Version: 2.0.5
Severity: normal Keywords: get_page_uri has-patch needs-test
Cc:

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

get_page_uri.patch (1.3 kB) - added by ryanscheuermann on 11/24/06 21:53:28.
fixed bug: include attachment uris
get_page_uri.2.0.5 (1.4 kB) - added by ryanscheuermann on 11/24/06 21:54:24.
faster get_page_uri for WP 2.0.5

Change History

11/19/06 14:24:58 changed by ryanscheuermann

  • version changed from 2.1 to 2.0.5.

This ticket could also be modified and applied to 2.0.6. I've attached that patch also.

11/24/06 21:53:28 changed by ryanscheuermann

  • attachment get_page_uri.patch added.

fixed bug: include attachment uris

11/24/06 21:54:24 changed by ryanscheuermann

  • attachment get_page_uri.2.0.5 added.

faster get_page_uri for WP 2.0.5

12/01/06 03:23:29 changed by matt

  • milestone changed from 2.1 to 2.2.

03/27/07 22:47:06 changed by foolswisdom

  • milestone changed from 2.2 to 2.4.

03/09/08 01:08:13 changed by hangy

  • keywords changed from get_page_uri to get_page_uri has-patch needs-test.
  • type changed from defect to enhancement.

03/19/08 03:35:52 changed by ffemtcj

  • milestone changed from 2.5 to 2.6.