simple utility to prune database