better index database cleanup
Merge pull request #1267 from john-hill/PLFM-2744

better index database cleanup