Kostas Papadopoulos <kostas@xxxxxxxxxxxxxxxxx> writes: > I cannot see how it can be configuration since the two databases are in the same > Postgres instance. There is such a thing as ALTER DATABASE ... SET to install different settings at the per-database level. In general, the answer to your question is that the databases are *not* identical. You just haven't figured out how yet. I'm wondering if it has something to do with the dump/reload having compacted out bloat in the tables or indexes, causing cost estimates to change. regards, tom lane