Re: Removing INNER JOINs

From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, Mart Kelder <mart(at)kelder31(dot)nl>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Simon Riggs <simon(at)2ndquadrant(dot)com>
Subject: Re: Removing INNER JOINs
Date: 2014-12-03 18:12:53
Message-ID: CAOeZVicW5gp0eGb1M5hLqpGEPryrBkLcm9imCcq354N_uPGaEg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 3, 2014 at 11:38 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Stephen Frost <sfrost(at)snowman(dot)net> writes:
> > * Atri Sharma (atri(dot)jiit(at)gmail(dot)com) wrote:
> >> Agreed, but in some cases, we could possibly make some assumptions (if
> >> there is no index, if a large fraction of table will be returned in
> scan,
> >> FunctionScan).
>
> > All neat ideas but how about we get something which works in the way
> > being asked for before we start trying to optimize it..? Maybe I'm
> > missing something, but getting all of this infrastructure into place and
> > making sure things aren't done to the plan tree which shouldn't be (or
> > done to all of them if necessary..) is enough that we should get that
> > bit done first and then worry if there are ways we can further improve
> > things..
>
> Yeah; moreover, there's no evidence that hard-wiring such assumptions
> would save anything. In the example of a FunctionScan, guess what:
> there's only one Path for that relation anyway.
>
> That is precisely what I meant :) I guess I was being too over cautious
and even trying to save the time spent in evaluating whatever paths we have
and building new FunctionScan paths...

> I think the right approach for now is to emulate the GEQO precedent as
> closely as possible. Build all the single-relation Paths the same as
> now, then do a join search over all the relations, then (if we've noticed
> that some joins are potentially removable) do another join search over
> just the nonremovable relations.
>

How about using geqo more liberally when replanning (decrease the number of
relations in join before geqo is hit?)

--
Regards,

Atri
*l'apprenant*

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-12-03 18:17:09 Re: Removing INNER JOINs
Previous Message Tom Lane 2014-12-03 18:11:44 Re: Removing INNER JOINs