[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
Thu Aug 16 18:58:13 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:
     Type:  defect (bug)                           |      Status:  new
 Priority:  normal                                 |   Milestone:  3.5
Component:  Optimization                           |     Version:  2.9
 Severity:  normal                                 |  Resolution:
 Keywords:  dev-feedback has-patch needs-feedback  |
---------------------------------------------------+------------------

Comment (by simonwheatley):

 Thanks for the feedback.

 Replying to [comment:13 nacin]:
 > Currently, ancestors are cached directly in the post object. This is
 really the only reason to look through the entire tree and invalidate
 caches. While revisions should never change, this would result with
 polluted data for their ancestors.

 I didn't follow this point, sorry.

 11399.sw.2.diff implements other suggestions (refactor wp_publish_post as
 a wrapper for wp_update_post, remove _save_post and associated add_action,
 don't recurse cleaning_post_caches in wp_delete_post).

 I think there is an issue with revision caches hanging around when posts
 are deleted in 11399.sw.2.diff. Possibly either manually call
 `clean_post_cache` on each revision within `wp_delete_post`, or have a
 boolean "hard" parameter for `clean_post_cache` which includes the
 revisions if set but defaults to off.

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


More information about the wp-trac mailing list