WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#15914 closed defect (bug) (invalid)

wp_check_post_hierarchy_for_loops can run alot of queries

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

Description

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 2 years ago.
Cheap fix for 3.1: Don't fire the filter for revisions. Untested.

Download all attachments as: .zip

Change History (8)

comment:1 markjaquith2 years ago

Just skip it for revisions.

nacin2 years ago

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

comment:2 nacin2 years ago

  • Keywords has-patch added

comment:3 ryan2 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.

comment:4 nacin2 years ago

  • Keywords reporter-feedback added

comment:5 westi2 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.

comment:6 westi2 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.

comment:7 westi2 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.