pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Meszaros Attila <tilla@draconis.elte.hu>
Cc: pgsql-sql@hub.org
Subject: Re: Optimizing Multiply Joins ???
Date: Wed, 13 Sep 2000 11:36:50 -0400
Message-ID: <7866.968859410@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.3.96.1000913113245.18199M-100000@draconis.csoma.elte.hu>
References: <Pine.LNX.3.96.1000913113245.18199M-100000@draconis.csoma.elte.hu>

Meszaros Attila <tilla@draconis.elte.hu> writes:
> Until we join no more than 10 tables the response time is below 0.2 s.
> joining the 11th table comes with a dramatic change: response time
> usually grows up to 5-7 s, 

That's interesting; apparently the regular optimizer is faster than the
GEQO optimizer for your style of query.  Try increasing the GEQO
threshold (pg_option "geqo_rels") to more than 11.

> 	I have examined the output of explain in all 3 cases, and I have
> 	the feeling that the planner simply forgets the best solutions
> 	in 2nd and 3rd case.

The GEQO planner does not guarantee to find an optimal solution, it
just does a random search through a limited number of possible solutions
and uses the best one it happened across.

> But I think (hope) we could have a solution, because all of our
> complex joins are following foreign keys. 

Actually, as the 7.1 code currently stands, a query that uses explicit
JOIN operators like yours does will always be implemented in exactly
the given join order, with no searching.  I haven't quite decided if
that's a bug or a feature ...

			regards, tom lane



view thread (8+ messages)  latest in thread

Message-ID: <7866.968859410@sss.pgh.pa.us>
Permalink:  ../7866.968859410@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7866.968859410@sss.pgh.pa.us

 · 

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-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, tilla@draconis.elte.hu, pgsql-sql@hub.org
  Subject: Re: Optimizing Multiply Joins ???
  In-Reply-To: <7866.968859410@sss.pgh.pa.us>
  References: <Pine.LNX.3.96.1000913113245.18199M-100000@draconis.csoma.elte.hu> <7866.968859410@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