Re: Query Analyzing - Mailing list pgsql-general

From Manfred Koizar
Subject Re: Query Analyzing
Date
Msg-id rrcajug3jo80tohqbm1g0f8fh6e1qcasqf@4ax.com
Whole thread Raw
In response to Re: Query Analyzing  ("Booth, Robert" <Robert_Booth@intuit.com>)
List pgsql-general
On Mon, 8 Jul 2002 11:16:34 -0700, "Booth, Robert"
<Robert_Booth@intuit.com> wrote:
>[about performance problems with a query containing two inner and
> eight outer joins]
Rob,

sorry for being quiet for so long, the printout of your mail got lost
in a pile of paper.

It wouldn`t have helped much, however, if I responded earlier.  I
could not find a hot spot in your query,  you are losing time
constantly,  not much with each outer join,  but it sums up.
Rewording your SQL won't help, AFAICS.

I thought of converting the outer joins to inner joins (you would have
to provide default entries in your lookup tables), writing the joins
in this form:
    FROM a, b, c ... WHERE a.b_id=b.id AND a.c_id=c.id ...
and letting the optimizer do its work, but I fear that you would again
end up with lots of hash joins.

Maybe caching the lookup tables in the frontend might help?

Servus
 Manfred

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: timestamped archive data index searches
Next
From: Richard Huxton
Date:
Subject: Re: Blank date field.. Help...