Re: left join performance problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pginfo <pginfo(at)t1(dot)unisoftbg(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: left join performance problem
Date: 2003-06-12 02:57:51
Message-ID: 26068.1055386671@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

pginfo <pginfo(at)t1(dot)unisoftbg(dot)com> writes:
> I have a big problem with pg left join performance.

I think the problem is that the LEFT JOIN clause is forcing the
planner to join A_SKLAD to A_MESKLAD before anything else, whereas
a good plan would do some of the other joins first to eliminate
as many rows as possible. You will need to revise the query to
let the LEFT JOIN happen later. For discussion see
http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=explicit-joins.html

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message pginfo 2003-06-12 04:48:27 Re: left join performance problem
Previous Message Tom Lane 2003-06-11 20:17:53 Re: tweaking costs to favor nestloop