Lowell Hought <lowell.hought@gmail.com> writes:
> Attached in three separate files.
Thanks. The only thing that's really obvious here is that the
rowcount estimates must be way off, because if the join outputs
were as small as the planner thinks, this query couldn't take
very long at all. I wonder whether your v17 installation is
lacking appropriate statistics. By now autovacuum should have
mostly filled that in even if you forgot to see to it when
transferring data --- but maybe you had larger-than-default
statistics targets in the v16 installation? Or some other
change to the default settings? I'd double-check that and
then do a manual ANALYZE of the whole database, and see if
anything changes.
regards, tom lane