Re: Removing INNER JOINs

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Mart Kelder <mart(at)kelder31(dot)nl>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Removing INNER JOINs
Date: 2014-12-04 03:24:10
Message-ID: CA+U5nM+ctehxtjQxo4Se04HB=49nFMVxW_a5S1BLC4a-pEHLtQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3 December 2014 at 12:18, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:

> So the planner keeps all possibility satisfying plans, or it looks at the
> possible conditions (like presence of foreign key for this case, for eg) and
> then lets executor choose between them?

I'm suggesting the planner keeps 2 plans: One with removable joins,
one without the removable joins.

You could, in theory, keep track of which tables had pending after
triggers and skip pruning of just those but that would require you to
grovel around in the after trigger queue, as well as keep a rather
large number of plans. I don't think this deserves that complexity,
since ISTM very likely we'll almost never need the full plans, so we
just make one short test to see if there is anything in the trigger
queue at all and if so skip the pruning of any joins.

The Executor already has a Result node which allows it to decide what
subnodes to execute at run time, so this is similar.

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2014-12-04 03:35:54 Re: inherit support for foreign tables
Previous Message Fujii Masao 2014-12-04 03:08:18 Re: tracking commit timestamps