We have this query below we found, it appears WP Geo Directory and Yoast are working together to build our xml sitemap, but the query seems to be buggy and crashes our site.
Can someone take a look to see?
SELECT tt.term_id, MAX(p.post_modified_gmt) AS date_gmt, l.region_slug AS region, l.city_slug AS city
FROM wp_g1a4rar7xx_geodir_post_locations l
LEFT JOIN wp_g1a4rar7xx_geodir_gd_place_detail pd ON ( pd.region = l.region AND pd.city = l.city )
LEFT JOIN wp_g1a4rar7xx_posts p ON p.ID = pd.post_id
LEFT JOIN wp_g1a4rar7xx_term_relationships
AS tr ON tr.object_id = p.ID
LEFT JOIN
wp_g1a4rar7xx_term_taxonomy
AS tt ON ( tt.term_taxonomy_id = tr.term_taxonomy_id AND tt.taxonomy = 'gd_placecategory' )
WHERE p.post_type = 'gd_place' AND p.post_status = 'publish' AND l.location_id IS NOT NULL AND tt.term_id IS NOT NULL AND l.country_slug LIKE 'united-states'
GROUP BY CONCAT(tt.term_id, '-', l.region_slug, '-', l.city_slug)
ORDER BY date_gmt DESC;