[wp-hackers] wp_list_authors and DB queries

Computer Guru computerguru at neosmart.net
Wed Nov 21 16:16:30 GMT 2007


It definitely should be possible to rewrite all that replacing those queries
with just two or three depending on what the plugin does.

Take a look at the database schema, study the code to see what it's trying
to accomplish, and write your own query + result processor to get the job
done. 117 is definitely unacceptable.


On 11/21/07, Bob <wp-hackers at nj-arp.org> wrote:
>
> 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
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Computer Guru
Director,
NeoSmart Technologies
http://neosmart.net/blog/


More information about the wp-hackers mailing list