I have a site with over 30000 nodes - had timeout issues with php. Changed the following lines of code to make it go through fast. SQL needs to be made "safe" but this works well and the xml file is created in a few seconds even when it creates the entire index.

Replace the if block in lines 1124 through 1141 in file gsitemap.module 1.56.2.61

    if ($node_count > $gsitemap_count) {
	$result = db_query("insert into gsitemap (nid, last_changed, pid) SELECT n.nid, n.changed, url_alias.pid from node n left join gsitemap g on n.nid=g.nid left join url_alias on src=concat('node/',n.nid) where g.nid is null");

      if (module_exists('comment')) {
        $result = db_query('update gsitemap,node_comment_statistics set gsitemap.last_comment=node_comment_statistics.last_comment_timestamp where gsitemap.nid=node_comment_statistics.nid');
      }
    }

Comments

vacilando’s picture

I have similar problems on my site. Can this or other patch be applied asap to speed up the sitemap generation?

darren oh’s picture

Status: Active » Fixed

Fixed in CVS commit 83785.

Anonymous’s picture

Status: Fixed » Closed (fixed)