Clodoaldo <clodoaldo.pinto.neto@gmail.com> writes:
> The same insert query takes 20 minutes in the production system and 2
> hours in the new one.
Hmph. It's the same plan, so it's not a planner mistake. Could you
post EXPLAIN ANALYZE rather than just EXPLAIN for both cases?
Also, it'd be worth watching "vmstat 1" output while the queries are
running on each system, to see if there's any obvious discrepancy
in behavior at that level.
regards, tom lane