[wp-trac] [WordPress Trac] #38878: REST API: Default query for users endpoint doesn't scale

WordPress Trac noreply at wordpress.org
Sun Nov 20 11:55:54 UTC 2016


#38878: REST API: Default query for users endpoint doesn't scale
--------------------------+--------------------------
 Reporter:  ocean90       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  4.7
Component:  REST API      |    Version:  trunk
 Severity:  normal        |   Keywords:  dev-feedback
  Focuses:                |
--------------------------+--------------------------
 The user query is performed with the `has_published_posts` argument which
 generates the following query

 > SELECT SQL_CALC_FOUND_ROWS wp_users.* FROM wp_users INNER JOIN
 wp_usermeta ON ( wp_users.ID = wp_usermeta.user_id ) WHERE 1=1 AND
 wp_users.ID IN ( SELECT DISTINCT wp_posts.post_author FROM wp_posts WHERE
 wp_posts.post_status = 'publish' AND wp_posts.post_type IN ( 'post',
 'page', 'attachment', 'forum', 'topic', 'reply' ) ) AND (
 wp_usermeta.meta_key = 'wp_2_capabilities') ORDER BY display_name ASC
 LIMIT 0, 10

 'forum', 'topic', and 'reply' are bbPress' post types. We use bbPress on
 wordpress.org/support/ where I noticed in the logs that the
 server/database can't handle the request.

 I'm currently not sure how and if this needs to be fixed but having at
 least a ticket for it might help others.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38878>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list