[wp-hackers] wp_list_authors and DB queries

Bob wp-hackers at nj-arp.org
Wed Nov 21 10:17:22 GMT 2007


I just installed the wp-authors plugin, and the number of database queries 
to generate an HTML page went from 23 to 117(!), and the time required 
increased by a full 1/10th second, a 40% increase.

I have 50 users registered on my blog, but only 10 of them are 
authors/editors/admins.  It seems that wp_list_authors() is doing two 
queries per user, even if they cannot write posts.

Is there any way to reduce the number of queries?  At worst case, shouldn't 
it be doing one query to get a list of users, then one query per user to 
count the posts?  That should be 51 extra queries not 94!  Also, if I could 
have it only check users who can actually write posts, that would be 
perfect.

Bob




More information about the wp-hackers mailing list