follow and fix https://www.postgresql-archive.org/track-planning-causing-performance-regression-td6143624.html