Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#19285 closed defect (bug) (duplicate)

Hierachical post types don't scale well - memory usage

Reported by: maxaud's profile maxaud Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2.1
Component: Posts, Post Types Keywords:
Focuses: Cc:


I recently created a custom post type that was hierarchical and was using it for data integration. I brought in 31,000 posts in the first 30 days and each post had a parent page set*. The page ran out of memory (256mb) when the post type was hierarchical. I set to false and it started to show again.

This looks to be the suspected area of holdup:
/wp-admin/includes/post.php - Line 884

 // Hierarchical types require special args.
 if ( is_post_type_hierarchical( $post_type ) && !isset($orderby) ) {
   $query['orderby'] = 'menu_order title';
   $query['order'] = 'asc';
   $query['posts_per_page'] = -1;
   $query['posts_per_archive_page'] = -1;

*This is a multisite install and it may be important to note that the parent of the posts is a post of a different post_type.

Change History (2)

#1 @maxaud
12 years ago

The page that ran out of memory was

(When you click to view the posts in the backend.)

#2 @duck_
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #15459.

Note: See TracTickets for help on using tickets.