Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#15914 closed defect (bug) (invalid)

wp_check_post_hierarchy_for_loops can run alot of queries

Reported by: westi Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Administration Keywords: has-patch reporter-feedback
Focuses: Cc:


If you have a post with alot of revisions and you save a new revision we will scan through all the revisions checking them out even though they are not really hierarchical.

This means that the revision save doesn't work as the page times out while still running all the queries.

We could probably either do some caching with a better call to get_posts first or not run this code for revisions.

Attachments (1)

15914.diff (654 bytes) - added by nacin 10 years ago.
Cheap fix for 3.1: Don't fire the filter for revisions. Untested.

Download all attachments as: .zip

Change History (8)

#1 @markjaquith
10 years ago

Just skip it for revisions.

10 years ago

Cheap fix for 3.1: Don't fire the filter for revisions. Untested.

#2 @nacin
10 years ago

  • Keywords has-patch added

#3 @ryan
10 years ago

The only time I see a revision processed is when autosave triggers. The loop checker walks up the autosave's 'page' parents. I see no revisions beyond the one autosave revision being processed.

#4 @nacin
10 years ago

  • Keywords reporter-feedback added

#5 @westi
10 years ago

I'm still trying to reproduce this with core post types and understand why the CPT I'm seeing this with is different.

#6 @westi
10 years ago

  • Milestone 3.1 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hmm this was a incorrect bug report.

The alot of queries are caused by something else.

#7 @westi
10 years ago

Part of the issue is #11399 - clean_post_cache and alot of revisions isn't fun.

Note: See TracTickets for help on using tickets.