Closed (fixed)
Project:
XML sitemap
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2009 at 01:08 UTC
Updated:
30 Dec 2009 at 19:30 UTC
Are there any plans to provide a rebuilding per "type" only? Today all active modules are called with an hook_xmlsitemap_links_clear() to delete their items, but deleting hundreds of thousands or millions of entries may time-out very quickly. I believe the modules are running into the same issues I see very often in core, see #643382: Clear cache all with TRUNCATE TABLE or update.php times out!. A TRUNCATE TABLE {xmlsitemap} would be much more efficient to empty the xmlsitemap table very very very quick.
Comments
Comment #1
dave reid1. You shouldn't be using the rebuild at all. Cron should be working and it should only be used as a last resort. So why are you using it in the first place.
2. TRUNCATE is not supported on all db types. There's db-independent support for it in D7 so I'll use it then.
3. For now you can active the 'developer mode' setting to get a module-select list on the rebuild form.
Comment #2
hass commented1. The software complains to me it's out of sync and need a full rebuild. Therefore I pressed the button.
2. For MySQL and PgSQL TRUNCATE TABLE is working in the same way and this are the only two platforms supported in D6. in D7 we have db_truncate() and it also works well. You should consider using TRUNCATE if a rebuild deletes all data in the first step.
Comment #3
dave reidIt says it's out of sync? Odd. Has that been a continual problem? Sure it doesn't just say you need to run cron?
By nature the hook_xmlsitemap_links_clear doesn't operate on the entire table, so we can't use truncate because of that either.
Comment #4
hass commentedNo, normally it works very well... it was out of sync for the reason that I've enabled the module after 80.000 nodes existed :-)
Comment #5
dave reidFYI I added a drush xmlsitemap rebuild command in case you want to use that. :)