Re: Tuning New Server (slow function) - Mailing list pgsql-performance

From Tom Lane
Subject Re: Tuning New Server (slow function)
Date
Msg-id 693.1150993192@sss.pgh.pa.us
Whole thread Raw
In response to Tuning New Server (slow function)  (Ron St-Pierre <ronDOTpgsql@shaw.ca>)
List pgsql-performance
Ron St-Pierre <ronDOTpgsql@shaw.ca> writes:
> We just purchased a new Dell PowerEdge 2800 (dual xeon, 8GB RAM, raid 4,
> RHEL, postgres 8.1) and ported our old database over to it (single cpu,
> 2GB RAM, no raid, postgres 7.4). Our apps perform great on it, however
> some queries are super slow. One function in particular, which used to
> take 15-30 minutes on the old server, has been running now for over 12
> hours:

A fairly common gotcha in updating is to forget to ANALYZE all your
tables after loading the data into the new server.  My bet is that some
of the queries in the function are using bad plans for lack of
up-to-date statistics.

If ANALYZEing and then starting a fresh session (to get rid of the
function's cached plans) doesn't help, you'll need to do some comparison
of EXPLAIN plans between old and new server to try to figure out where
the problem is.

            regards, tom lane

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Why is my (empty) partial index query slow?
Next
From: Tom Lane
Date:
Subject: Re: Poor performance - fixed by restart