I'm trying to help in fire worker mode for a friend who got a well customized wp site (2.8.2). The developer of the site pushed a release on Monday and the site is crazily slow now. The new release came with some nasty importing scripts, which basically made the DB grew a lot. The developer now is dodging and totally bs my friend, so basically now, it's on me!
Digging into various places helped me to understand that the "Events" section of the site kills everything on the site. I was able to correlate it to a DB query which appears in mysql slow query log:
# Time: 110204 12:15:00
# User@Host: xxxxxxx
# Query_time: 83 Lock_time: 23 Rows_sent: 8 Rows_examined: 738690
use xxxx;
SET timestamp=1296818087;
SELECT *
FROM wp_1_posts,wp_1_term_taxonomy,wp_1_terms,wp_1_term_relationships,wp_1_ec3_schedule, wp_1_postmeta
WHERE wp_1_terms.term_id='95'
AND wp_1_term_taxonomy.term_id='95'
AND wp_1_term_taxonomy.parent='3'
AND wp_1_term_taxonomy.term_taxonomy_id=wp_1_term_relationships.term_taxonomy_id
AND wp_1_posts.ID=wp_1_term_relationships.object_id
AND wp_1_ec3_schedule.post_id=wp_1_posts.ID
AND ( wp_1_ec3_schedule.start>=UTC_TIMESTAMP()
OR wp_1_ec3_schedule.end>=UTC_TIMESTAMP() )
ORDER BY start ASC LIMIT 24,8;
The query is bogus, as wp_1_postmeta isn't joined to anything (so it basically select * for nothing, great!). Where do I have to dig to customize those calls ?
I have looked at what files where modified / added during this push, and I don't think that's a "new call". I guess it's because the DB grew so much that this bogus query became problematic. From what I see, when I enter the script which displays the posts, the bad is already done. Any help will be highly appreciated!
functions.phpfile in the/wp-content/themes/{your-theme-dir}/directory to see if he has the custom code there, and if not look for a custom plugin which might show up onhttp://yoursite.com/wp-admin/plugins.php; if you find one look in the plugins subdirectory in/wp-content/plugins/to see if the code is in there. – MikeSchinkel♦ Feb 4 '11 at 15:52