I've committed this patch with additional editorialization --- mostlycosmetic changes, except for removing the stats-driven cleanup in favorof letting cleanups occur during auto-ANALYZE, as per my suggestionyesterday.
regards, tom lane