Re: planner missing a trick for foreign tables w/OR conditions - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: planner missing a trick for foreign tables w/OR conditions
Date
Msg-id CA+U5nMJPv1SsFcBHVFOm2pLJv1cBJFs=0gzVdg2kgXfiGQ1MdA@mail.gmail.com
Whole thread Raw
In response to Re: planner missing a trick for foreign tables w/OR conditions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: planner missing a trick for foreign tables w/OR conditions
List pgsql-hackers
On 17 December 2013 17:28, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> So at this point I'm pretty much talked into it.  We could eliminate the
> dependence on indexes entirely, and replace this code with a step that
> simply tries to pull single-base-relation quals out of ORs wherever it can
> find one.  You could argue that the produced quals would sometimes not be
> worth testing for, but we could apply a heuristic that says to forget it
> unless the estimated selectivity of the extracted qual is less than,
> I dunno, 0.5 maybe.  (I wonder if it'd be worth inserting a check that
> there's not already a manually-generated equivalent clause, too ...)

Sounds sensible.

What surprises me is we don't have an API that allows an FDW to decide
what it can accept or not. It seems strange to have a unilateral
decision by our planner about what another planner is capable of.
Should we extend the API to allow the question to be asked?

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



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Extension Templates S03E11
Next
From: Bruce Momjian
Date:
Subject: Re: [bug fix] multibyte messages are displayed incorrectly on the client