On Monday, September 26, 2016 9:44 AM, Tom Lane <t...@sss.pgh.pa.us> wrote:
>> Paul Jones <p...@cmicdo.com> writes: >> For a freshly pg_restore'd 9.2 database, would VACUUM ANALYZE update >> statistics any better than just an ANALYZE? > > VACUUM would have caused the page-all-visible flags to get set for all > pages of unchanging tables. I don't recall whether ANALYZE has any side > effects on those flags at all, but it certainly would not have set them > for pages it didn't even visit, which would be most. > > Net result is that the pg_class.relallvisible fractions didn't get high > enough to persuade the planner that index-only scans would be effective. > I guess you could call that a statistic, but it's really about the > contents of the tables' free space maps. > > regards, tom lane This is good to know. I think we will be running VACUUM ANALYZE from now on after restore instead of just ANALYZE. I do note that sect. 49.11 claims that ANALYZE updates pg_class.relallvisible. I don't know if this is a documentation problem in light of what you explained. PJ