Make WordPress Core

Opened 15 years ago

Closed 3 weeks ago

#11381 closed defect (bug) (wontfix)

display_page_row() generates boat loads of needless queries

Reported by: denis-de-bernardy's profile Denis-de-Bernardy Owned by: pbearne's profile pbearne
Milestone: Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: needs-patch
Focuses: performance, administration Cc:


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 15 years ago.
11381.2.diff (1.6 KB) - added by wonderboymusic 9 years ago.

Download all attachments as: .zip

Change History (16)

#1 @Denis-de-Bernardy
15 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
15 years ago

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

#3 @Denis-de-Bernardy
15 years ago

  • Keywords has-patch added

#4 @nacin
14 years ago

  • Milestone changed from 3.0 to Future Release

#5 @nacin
10 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
10 years ago

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

#7 @wonderboymusic
9 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
9 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.

9 years ago

#10 @SergeyBiryukov
9 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
9 years ago

In 35223:

In WP_Posts_List_Table, correct the type for $comment_pending_count.

See #11381.

#12 @wonderboymusic
9 years ago

  • Milestone changed from 4.4 to Future Release

WP_User_Query needs cache improvements

#13 @pbearne
4 months ago

  • Owner set to pbearne
  • Status changed from new to assigned

Looking at this ticket I can't see what is left to be done
I suspect we can close this

#14 @pbearne
3 weeks ago

  • Resolution set to wontfix
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.