WordPress.org

Make WordPress Core

Opened 9 years ago

Last modified 3 years ago

#11381 new defect (bug)

display_page_row() generates boat loads of needless queries

Reported by: Denis-de-Bernardy Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: needs-patch
Focuses: performance, administration Cc:

Description

on sites with many static pages that are spread across multiple parents, display_page_row() triggers multitudes of calls to the db.

specifically, it's repeatedly calling get_pending_comments_num(). it's also calling get_editable_user_ids() and wp_dropdown_users(), both of which do not seem to cache their results in case they're used several times on the same page.

Attachments (2)

11381.diff (1.6 KB) - added by Denis-de-Bernardy 9 years ago.
11381.2.diff (1.6 KB) - added by wonderboymusic 3 years ago.

Download all attachments as: .zip

Change History (14)

#1 @Denis-de-Bernardy
9 years ago

a similar problem exists on the edit posts page, with _post_row() and inline_edit_row().

in particular, there are multiple calls to get_tags_to_edit(), in spite of the fact that the latter seem cached towards the beginning of the page.

#2 @Denis-de-Bernardy
9 years ago

edit media also does huge numbers of calls to get_pending_comments_num()

#3 @Denis-de-Bernardy
9 years ago

  • Keywords has-patch added

#4 @nacin
8 years ago

  • Milestone changed from 3.0 to Future Release

#5 @nacin
4 years ago

  • Component changed from Optimization to Administration
  • Focuses performance added

I think some of this is improved. get_pending_comments_num() still looks not so improved.

#6 @nacin
4 years ago

  • Component changed from Administration to Posts, Post Types
  • Focuses administration added

#7 @wonderboymusic
3 years ago

In 34127:

In WP_Media_List_Table, fetch all pending comment counts at once, instead of for each row in the loop.

See #11381.

#8 @wonderboymusic
3 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from Future Release to 4.4

get_users() is still missing a cache

This ticket was mentioned in Slack in #core by sergey. View the logs.


3 years ago

#10 @SergeyBiryukov
3 years ago

In 35222:

In WP_Media_List_Table, rename $pending_count to $comment_pending_count and mark it as protected, for consistency with WP_Posts_List_Table.

See #11381.

#11 @SergeyBiryukov
3 years ago

In 35223:

In WP_Posts_List_Table, correct the type for $comment_pending_count.

See #11381.

#12 @wonderboymusic
3 years ago

  • Milestone changed from 4.4 to Future Release

WP_User_Query needs cache improvements

Note: See TracTickets for help on using tickets.