From: Dave Dutcher <dave@tridecap.com>
To: 'Rafael Martinez Guerrero' <r.m.guerrero@usit.uio.no>
Cc: pgsql-performance@postgresql.org
Subject: Re: Help with optimizing a sql statement
Date: Thu, 9 Feb 2006 13:44:22 -0600
Message-ID: <001f01c62db1$3a380910$8300a8c0@tridecap.com> (raw)
In-Reply-To: <20060209193345.GV57845@pervasive.com>
First I'm wondering if the tables have been recently analyzed. If an
analyze has been run recently, then it is probably a good idea to look
at the statistics target.
-----Original Message-----
From: pgsql-performance-owner@postgresql.org
[mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Jim C.
Nasby
Sent: Thursday, February 09, 2006 1:34 PM
To: Rafael Martinez Guerrero
Cc: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] Help with optimizing a sql statement
At least part of the problem is that it's way off on some of the row
estimates. I'd suggest upping the statisticss target on at least all of
the join columns to at least 100. (Note that it's doing a nested loop
thinking it will have only 2 rows but it actually has 22000 rows).
On Thu, Feb 09, 2006 at 04:10:27PM +0100, Rafael Martinez Guerrero
wrote:
> Hello
>
> We are running an application via web that use a lot of time to
perform
> some operations. We are trying to find out if some of the sql
statements
> used are the reason of the slow speed.
>
> We have identified a sql that takes like 4-5000ms more than the second
> slowest sql in out test server. I hope that we will get some help to
try
> to optimize it.
>
> Thanks in advance for any help.
>
[Snip]
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: dave@tridecap.com, r.m.guerrero@usit.uio.no
Subject: Re: Help with optimizing a sql statement
In-Reply-To: <001f01c62db1$3a380910$8300a8c0@tridecap.com>
* 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