Re: Removing INNER JOINs

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)2ndquadrant(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: 2015-01-13 11:20:49
Message-ID: CAApHDvpv+11oV_ThjN9QF4JtNjw4L=Tct1Afho3ac49pXqtx8g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12 January 2015 at 15:57, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Thu, Jan 8, 2015 at 6:31 AM, David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
> > I'd be keen to know what people's thoughts are about the
> nodeAlternativePlan
> > only surviving until the plan is initialised.
>
> I find it scary, although sometimes I am easily frightened.
>
>
Ok remember I'm not actually modifying the plan like I was in the earlier
version of the patch. The Alternative Plan node just simply initialises the
correct plan and instead of returning it's own initialised state, it
returns the initialised state of the selected plan's root node.

I have to admit, it didn't really become clear in my head if the frenzy of
discussion above gave any sort of indication that this "Alternative plan
node" would remain and be shown in the EXPLAIN output, or the appropriate
plan would be selected during plan initialisation and the new root node
would become that of the selected plan. When I was implement what was
discussed, I decided that it would be better to choose the correct plan
during initialisation rather than transitioning through the "Alternative
plan node" for each row. As proved already on this thread, transitioning
through needless nodes adds needless executor time overhead.

Also if we kept the alternative plan node, then I think the explain would
look rather weird and frighteningly complex, as it would effectively be 2
plans in 1.

I'm actually quite happy with how simple the executor changes became. It's
far more simple and clean than the node stripping code that I had in an
earlier version. The parts of the patch that I'm concerned might raise a
few eyebrows are the changes to query_planner() as it now returns a List of
RelOptInfo instead of a RelOptInfo.

Regards

David Rowley

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marco Nenciarini 2015-01-13 11:22:24 Re: [RFC] LSN Map
Previous Message Michael Paquier 2015-01-13 11:14:43 Re: Memory leak in receivelog.c when receiving stream