pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: pginfo <pginfo@t1.unisoftbg.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: left join performance problem
Date: Thu, 12 Jun 2003 06:48:27 +0200
Message-ID: <3EE8061B.1FAED8AD@t1.unisoftbg.com> (raw)
References: <3EE74C2D.88390062@t1.unisoftbg.com>
	<26068.1055386671@sss.pgh.pa.us>

Many thanks Tom,
the doc do not contain solution for this case, but the idea to
change the join order was excelent and all is working fine at the moment.

regards,
ivan.

Tom Lane wrote:

> pginfo <pginfo@t1.unisoftbg.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

view thread (9+ messages)  latest in thread

Message-ID: <3EE8061B.1FAED8AD@t1.unisoftbg.com>
Permalink:  ../3EE8061B.1FAED8AD@t1.unisoftbg.com/
Also on:    postgresql.org/message-id/3EE8061B.1FAED8AD@t1.unisoftbg.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: pginfo@t1.unisoftbg.com, tgl@sss.pgh.pa.us
  Subject: Re: left join performance problem
  In-Reply-To: <3EE8061B.1FAED8AD@t1.unisoftbg.com>
  References: <3EE74C2D.88390062@t1.unisoftbg.com> <26068.1055386671@sss.pgh.pa.us> <3EE8061B.1FAED8AD@t1.unisoftbg.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