WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
[resolved] Performance Suggestion (6 posts)

  1. softclick
    Member
    Posted 2 years ago #

    Your code:

    $posts = $wpdb->get_results("SELECT ID, post_content, post_name, post_author, post_parent, post_modified_gmt, post_date, post_date_gmt
    											FROM $wpdb->posts
    WHERE post_status = 'publish'
    AND	post_password = ''
    AND post_type = '$post_type'
    ORDER BY post_modified ASC
    LIMIT $steps OFFSET $offset");

    My Code

    $posts = $wpdb->get_results("SELECT l.ID, post_content, post_name, post_author, post_parent, post_modified_gmt, post_date, post_date_gmt
    											FROM ( SELECT ID FROM $wpdb->posts
    WHERE post_status = 'publish'
    AND	post_password = ''
    AND post_type = '$post_type'
    ORDER BY post_modified ASC
    LIMIT $steps OFFSET $offset) o
    JOIN $wpdb->posts l
    ON 	l.ID = o.id
    ORDER BY l.id");

    Should be app. 100 times faster. See here:
    http://explainextended.com/2009/10/23/mysql-order-by-limit-performance-late-row-lookups/

    On large Blogs (we have > 100.000 posts on http://www.naanoo.com) otherwise the database queries caused by the plugin will kill the server.

    With sunny regards from Germany,

    Sebastian

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. Hubert Nguyen
    Member
    Posted 2 years ago #

    Hi softclick, I'm bumping into the exact same issue, although I have less (sub-80k). This request takes a while and keeps the server super-busy.

  3. Ricardo
    Member
    Posted 2 years ago #

    softclick, in case you are interested, I'm trying your approach in my server. I also reported this as a bug in this thread:

    http://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-sitemap-feature-kills-my-server

    I'll keep trying and post any new information there.

    Cheers,

    Ricardo

  4. Joost de Valk
    Member
    Plugin Author

    Posted 2 years ago #

    I just committed this to the development version, if you all could give it a whirl I'd super appreciate that!

  5. Joost de Valk
    Member
    Plugin Author

    Posted 2 years ago #

    So far looks like a pretty good change, so we're going to keep it in.

  6. Hubert Nguyen
    Member
    Posted 2 years ago #

    Joost, thanks for the heads-up! The Sitemap performance is not yet fast enough for us, but keep us posted. We'll test it again.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic