HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Postgres extremely slow after upgrade from Version 10 to 11

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
afterpostgresextremelyversionslowfromupgrade

Problem

Related to this:PostgreSQL extremely slow after upgrade from 9.3 to 9.4
but trying to understand better...

My queries was slow after upgrading to Postgres Version 11.5 from 10.7
I first ran ANALYZE on the DB but still was slow!
so I can VACUUM ANALYZE on the DB, and was still slow...

as a last resort, I am running VACUUM FULL ANALYZE on a table by table basis using psycopg2 with autocommit on (http://initd.org/psycopg/docs/connection.html#connection.autocommit) to be able to run it in psycopg2

one table is taking hours to do ...
while I wait, I can't help but wonder what went wrong.
The reduction of the query performance was mainly from UPSERT.

Solution

The output of pg_upgrade includes this:

...

Upgrade Complete
----------------
Optimizer statistics are not transferred by pg_upgrade so,
once you start the new server, consider running:
    ./analyze_new_cluster.sh

...


We found horrible performance straight after the upgrade until we ran this, lesson learned to read the output :)

Code Snippets

...

Upgrade Complete
----------------
Optimizer statistics are not transferred by pg_upgrade so,
once you start the new server, consider running:
    ./analyze_new_cluster.sh

...

Context

StackExchange Database Administrators Q#252105, answer score: 4

Revisions (0)

No revisions yet.