[wp-trac] [WordPress Trac] #15170: Network admin pages don't scale

WordPress Trac wp-trac at lists.automattic.com
Wed Oct 20 16:15:17 UTC 2010


#15170: Network admin pages don't scale
--------------------------+-------------------------------------------------
 Reporter:  ryan          |       Owner:     
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.1
Component:  Multisite     |     Version:  3.1
 Severity:  normal        |    Keywords:     
--------------------------+-------------------------------------------------
Description changed by ryan:

Old description:

> network/sites.php and network/users.php do queries like:
>
> {{{
> SELECT COUNT(wp_trunk_users.ID) FROM wp_trunk_users WHERE 1=1
>
> SELECT COUNT( blog_id ) FROM wp_trunk_blogs WHERE site_id = '1'ORDER BY
> wp_trunk_blogs.blog_id ASC
> }}}
>
> These are very slow on large networks.  get_blog_count() and
> get_user_count() would mitigate this somewhat, although they too can
> cause problem on large networks.
>
> Perhaps users.php and sites.php should consult get_user_count() and
> get_blog_count() and not do a query if the count is over a certain
> threshold. The tables would default to being empty and a search would
> have to be performed to get results.
>
> Further, a large network flag may be needed so that functions like
> get_blog_count() and get_user_count() can avoid ever running COUNT
> queries and instead rely on the network admin to perform counts and
> populate the count site options via a separate job.

New description:

 network/sites.php and network/users.php do queries like:

 {{{
 SELECT COUNT(wp_trunk_users.ID) FROM wp_trunk_users WHERE 1=1

 SELECT COUNT( blog_id ) FROM wp_trunk_blogs WHERE site_id = '1'ORDER BY
 wp_trunk_blogs.blog_id ASC
 }}}

 These are very slow on large networks.  get_blog_count() and
 get_user_count() would mitigate this somewhat, although they too can cause
 problem on large networks.

 Perhaps users.php and sites.php should consult get_user_count() and
 get_blog_count() and not do a query if the count is over a certain
 threshold. The tables would default to being empty and a search would have
 to be performed to get results.

 Further, a large network flag may be needed so that functions like
 get_blog_count() and get_user_count() can avoid ever running COUNT queries
 and instead rely on the network administrator to perform counts and
 populate the count site options via a separate job.

--

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15170#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list