It’s most likely because table wp_posts in database doesn’t have index for last modified date (and you have 200000 posts). It’s related to:
https://core.trac.wordpress.org/ticket/15499
https://github.com/Yoast/wordpress-seo/issues/12161
You should try to create index for last modified date (in phpMyAdmin):
create index type_status_modified on wp_posts(post_type,post_status,post_modified_gmt);
Did that, We decreased our total posts to 50k now. But still sitemap doesnt work.
Another thing I want to add here is that Yoast is showing some strange things after last update.
Like this http://prntscr.com/mztpts
on the main page.
@pavanbhat
Sorry to hear about your issues. We suggest the following:
1. Make sure to update your Yoast SEO version to 10.0.1. If you update the plugin, does the issue resolve?
2. Try toggling the Yoast sitemap under SEO > General > Features > XML sitemap and check if it works.
3. Clear any caching on your site.
4. Perform a conflict check.
I still see 500 error (after few seconds):
$ date; curl -i www.xxxxxxxxxx.net/sitemap_index.xml; date
Wed, Mar 27, 2019 10:12:51 AM
HTTP/1.0 500 Internal Server Error
Date: Wed, 27 Mar 2019 09:12:57 GMT
Server: Apache/2.4.18 (Ubuntu)
Content-Length: 0
Connection: close
Content-Type: text/html; charset=UTF-8
Wed, Mar 27, 2019 10:12:57 AM
Please try to enable debugging in WordPress. You could add following constants into wp-config.php (bellow comment For developers: WordPress debugging mode.):
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', true);
PHP Notices/Warnings/Errors will be logged to wp-content/debug.log. Please check current settings for max_execution_time and try to temporary increase it.
We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.