Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5530

varange on "slow-queries with many posts. what is this sql SELECT doing?"

$
0
0

This query exists in wp-content/plugins/wordpress-seo/inc/class-sitemaps.php on line 707.

$query = $wpdb->prepare( "SELECT l.ID, post_title, post_content, post_name, post_author, post_parent, ".
                "post_modified_gmt, post_date, post_date_gmt FROM ".
                "( SELECT ID FROM $wpdb->posts {$join_filter} WHERE ".
                "post_status = '%s' AND post_password = '' AND post_type = '%s' AND post_author != 0 ".
                "AND post_date != '0000-00-00 00:00:00' {$where_filter} ".
                "ORDER BY post_modified ASC LIMIT %d OFFSET %d ) o JOIN $wpdb->posts l ON l.ID = o.ID ORDER BY l.ID",
                $status, $post_type, $steps, $offset
            );

There was already a problem with this query being slow in the past, but Yoast updated it.

https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-performance-suggestion?replies=6
and
http://explainextended.com/2009/10/23/mysql-order-by-limit-performance-late-row-lookups/

I'm stuck now.


Viewing all articles
Browse latest Browse all 5530

Trending Articles