This is all courtesy of the Workflow Auto Cleanup timer job in the config section. Apparently it's done for "performance considerations" - but nobody really goes into much detail explaining this. It also makes no sense to me why you'd bother to delete the association - but leave all the detail..??
It seems Microsoft's intended purpose for the workflow history log is more like an IIS or Sharepoint log - meant to be recycled/not permanent (but then why do they not really delete it??).
Anyway, it seems we basically have three options:
- Disable the Workflow Auto Cleanup timer job completely
- You can include a specific xml tag in your workflow feature.xml file that controls the number of days retained for the workflow history (max days = 9999)
- Run a job nightly to force all the workflow history retention settings to a certain number of days (max days = 9999)
But my concern is obviously what kind of performance issues we're really talking about here if we make these changes.
You can find more detailed information on the xml tag, the code details for the nightly job, and information in general on Dave Wollerman's blog and Robert Bogue's blog.