Re: Allowing join removals for more join types

From: Noah Misch <noah(at)leadboat(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Dilip kumar <dilip(dot)kumar(at)huawei(dot)com>
Subject: Re: Allowing join removals for more join types
Date: 2014-06-05 23:36:23
Message-ID: 20140605233623.GA421700@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 05, 2014 at 02:12:33AM +0200, Andres Freund wrote:
> On 2014-06-04 20:04:07 -0400, Noah Misch wrote:
> > On Wed, Jun 04, 2014 at 10:14:42AM -0400, Tom Lane wrote:
> > > It's possible that we could apply the optimization only to queries that
> > > have been issued directly by a client, but that seems rather ugly and
> > > surprise-filled.
> >
> > ... such as this idea. It's a good start to a fairly-hard problem. FKs are
> > also always valid when afterTriggers->query_depth == -1, such as when all
> > ongoing queries qualified for EXEC_FLAG_SKIP_TRIGGERS. What else? We could
> > teach trigger.c to efficiently report whether a given table has a queued RI
> > trigger. Having done that, when plancache.c is building a custom plan, the
> > planner could ignore FKs with pending RI checks and use the rest. At that
> > point, the surprises will be reasonably-isolated.
>
> A bit more crazy, but how about trying trying to plan joins with a added
> one-time qual that checks the size of the deferred trigger queue? Then
> we wouldn't even need special case plans.

That, too, sounds promising to investigate.

--
Noah Misch
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-06-05 23:44:31 Re: Allowing join removals for more join types
Previous Message Michael Paquier 2014-06-05 23:03:35 Re: slotname vs slot_name