From: Tom Lane <tgl@sss.pgh.pa.us>
To: Manuel Sugawara <masm@fciencias.unam.mx>
Cc: pgsql-sql@postgresql.org
Subject: Re: left join query does not perform well
Date: Sun, 25 Aug 2002 11:12:23 -0400
Message-ID: <5882.1030288343@sss.pgh.pa.us> (raw)
In-Reply-To: <m3hehja80c.fsf@dep4.fciencias.unam.mx>
References: <m3hehja80c.fsf@dep4.fciencias.unam.mx>
Manuel Sugawara <masm@fciencias.unam.mx> writes:
> Ouch, 3117.48 msec vs. 1.15 msec is a huge difference. I need
> something else? or may be postgres optimizer can't cope with
> left/right joins?
I think the problem is you're constraining the join order into a very
inefficient one. See
http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/explicit-joins.html
But it's difficult to be sure, when you are showing us EXPLAIN output
that manifestly doesn't correspond to what you say the queries are.
For instance the nearest match to "epr_vord_grupo AS grupo" in the
explain output is "epr_ord_grupo g" ... I'm also wondering if any of
the tables used in the queries are really views, and if so what the
view definitions are.
regards, tom lane
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-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, masm@fciencias.unam.mx
Subject: Re: left join query does not perform well
In-Reply-To: <5882.1030288343@sss.pgh.pa.us>
* 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