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!

link|improve this question
If it is a heavily customized system you first need to track down what page is calling that URL. Can you find the URL that is calling the query and add the URL to your question? BTW, you might quickly look in the theme's functions.php file 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 on http://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
The site is loaded now, I can't even get the URLs! I'm logging in by ssh to check the function.php file. More on the URL as soon as I can! – MatthieuP Feb 4 '11 at 16:05
feedback

closed as too localized by toscho Apr 30 at 1:29

This question is unlikely to ever help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. See the FAQ for guidance on how to improve it.

Browse other questions tagged or ask your own question.