From: Craig Ringer <ringerc@ringerc.id.au>
To: hyelluas <helen_yelluas@mcafee.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: tunning strategy needed
Date: Thu, 18 Aug 2011 13:45:48 +0800
Message-ID: <4E4CA70C.9050209@ringerc.id.au> (raw)
In-Reply-To: <1313620811606-4710245.post@n5.nabble.com>
References: <1313620811606-4710245.post@n5.nabble.com>
On 18/08/2011 6:40 AM, hyelluas wrote:
> Hello,
>
> I have an old application that was written on Postgres 8.1.
> There are a few hundreds tables, 30-40 columns per table, hundreds of
> views, and all the sql is inside java code.
>
> We are moving it to 8.4, it seems to be VERY slow.
> There are 20-30 tables transactions - the objects are spread acrross
> multiple tables and some tables have data from different objects.
>
> I need a short term tuning strategy minimizing rewrite& redesign.
>
>
- Turn on auto explain and slow query logging
- Examine the slow queries and plans. Run them manually with EXPLAIN
ANALYZE. Check that the statistics make sense and if they're inaccurate,
increase the statistics targets on those columns/tables then re-ANALYZE.
- If the stats are accurate but the query is still slow, try playing
with the cost parameters and see if you get a better result, then test
those settings server-wide to see if they improve overall performance.
--
Craig Ringer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: ringerc@ringerc.id.au, helen_yelluas@mcafee.com
Subject: Re: tunning strategy needed
In-Reply-To: <4E4CA70C.9050209@ringerc.id.au>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox