From: Dario <dario_d_s@unitech.com.ar>
To: pgsql-performance@postgresql.org
Subject: Re: join and query planner
Date: Mon, 18 Jul 2005 16:24:19 -0300
Message-ID: <MHEDJHCKDNOEHJKHIOCJEEMDCEAA.dario_d_s@unitech.com.ar> (raw)
In-Reply-To: <s2dba73f.020@gwmta.wicourts.gov>
Hi.
> Just out of curiosity, does it do any better with the following?
>
> SELECT ...
Yes, it does.
But my query could also be
SELECT ...
FROM a
JOIN b ON (a.key = b.key)
LEFT JOIN c ON (c.key = a.key)
LEFT JOIN d ON (d.key=a.key)
/*new*/ , e
WHERE (b.column <= 100)
/*new*/ and (e.key = a.key) and (e.field = 'filter')
because it's constructed by an application. I needed to know if, somehow,
someway, I can "unforce" join order.
The only way to solve it so far is changing application. It must build
something like
SELECT ...
FROM b
JOIN (a JOIN e ON (e.key = a.key)) ON (a.key = b.key)
LEFT JOIN c ON (c.key = a.key)
LEFT JOIN d ON (d.key=a.key)
WHERE (b.column <= 100) and (e.field = 'filter')
Supossed that e.field has (should have) better selectivity. But now this
problem belongs to programmer's group :-)
The query, in fact, has more tables to join. I wonder if lowering geqo
threshold could do the work...
Thank you. Greetings. Long life, little spam and prosperity!
-----Mensaje original-----
De: pgsql-performance-owner@postgresql.org
[mailto:pgsql-performance-owner@postgresql.org]En nombre de Kevin
Grittner
Enviado el: lunes, 18 de julio de 2005 14:58
Para: pgsql-performance@postgresql.org; dariop@unitech.com.ar
Asunto: Re: [PERFORM] join and query planner
Just out of curiosity, does it do any better with the following?
SELECT ...
FROM a
JOIN b ON (a.key = b.key)
LEFT JOIN c ON (c.key = a.key)
LEFT JOIN d ON (d.key=a.key)
WHERE (b.column <= 100)
>>> snipp
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: dario_d_s@unitech.com.ar
Subject: Re: join and query planner
In-Reply-To: <MHEDJHCKDNOEHJKHIOCJEEMDCEAA.dario_d_s@unitech.com.ar>
References: <s2dba73f.020@gwmta.wicourts.gov> <MHEDJHCKDNOEHJKHIOCJEEMDCEAA.dario_d_s@unitech.com.ar>
* 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