Some db maintenance stuff.