[wp-trac] [WordPress Trac] #11399: clean_post_cache() generates enormous amounts of queries on sites with lots of pages, revisions or attachments

WordPress Trac wp-trac at lists.automattic.com
Sat Sep 22 15:55:06 UTC 2012


#11399: clean_post_cache() generates enormous amounts of queries on sites with lots
of pages, revisions or attachments
-------------------------------+---------------------
 Reporter:  Denis-de-Bernardy  |       Owner:  nacin
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:  3.5
Component:  Optimization       |     Version:  2.9
 Severity:  normal             |  Resolution:  fixed
 Keywords:  has-patch          |
-------------------------------+---------------------
Changes (by nacin):

 * owner:   => nacin
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [21952]:
 {{{
 #!CommitTicketReference repository="" revision="21952"
 Stop cleaning the cache of a post's children. Ancestors are no longer
 cached against the post object, which means this kind of walking is
 unnecessary. It is also prohibitively expensive with large hierarchies.

 We need to remove post_ancestors non-persistent caching for this.
 get_post_ancestors() can simply rely on the caching of get_post() instead.
 Previously, it was a direct query, hence the extra layers of caching and
 clearing.

 Child cache clearing stays in wp_delete_post() as children get a new
 parent.

 fixes #11399.
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11399#comment:23>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list