On 4/5/19 6:23 AM, Rob Northcott wrote: > Ah, fair enough – I’ll get into the habit of doing that then. Thanks again. > > Rob > *From:*Ron <ronljohnsonjr@xxxxxxxxx> > *Sent:* 05 April 2019 11:07 > *To:* pgsql-general@xxxxxxxxxxxxxxxxxxxx > *Subject:* Re: Query much slower on 9.6.5 than on 9.3.5 > > pg_dump/restore gets rid of all the dead space, and you should *always* > run an ANALYZE after pg_restore, since pg_restore doesn't populate the > statistics tables. After the dump/restore cycle I would recommend a "VACUUM FREEZE ANALYZE" if you can tolerate the time it takes, as this will not only ensure that the statistics are populated, but it will also get future rewrites of the rows out of the way all at once (visibility hint bits and freezing of the tuples). Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development