pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Cc: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat
Date: Wed, 16 Mar 2016 12:52:49 -0400
Message-ID: <19867.1458147169@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+Tgmoa80ZmsSYynOinCF3zzqx5kLE6Eetj3GE=hRPCV5tXB-w@mail.gmail.com>
References: <E1aOrwD-0004Af-Rm@gemulon.postgresql.org>
	<20160312031502.lqtbqnqor4vji62k@alap3.anarazel.de>
	<CA+TgmoZqPKh-dx2HFGLc76RNV1mUBwj7O5imtSLkuw8xj8_8Lw@mail.gmail.com>
	<20160312194625.txlzu22xykgpu66n@alap3.anarazel.de>
	<56E6240E.5090301@lab.ntt.co.jp>
	<18299.1457923919@sss.pgh.pa.us>
	<CA+TgmoZaiM80TJySOhk6DR3fqHbZEELTuyVboL6MOtvFqKmJ6w@mail.gmail.com>
	<3221.1457975148@sss.pgh.pa.us>
	<CA+Tgmoa2tXRFo1_sBpAZu9J3OpGJr6J3EJ5AaxcxDLtNcs6SqA@mail.gmail.com>
	<CAFjFpRdnWjSM=s6mKx6mwXcMJr_z398ys1UeCV28_7qOAW0yhA@mail.gmail.com>
	<CA+TgmoaT7Q5H8SsCf1_xtgRcSGzYxSMMMj21okwt3ju6Y9Xb9A@mail.gmail.com>
	<CAFjFpRcGU+p7z99w6S0inMJcxPH02mtj3cWeYUDcz0txU1frLw@mail.gmail.com>
	<CA+Tgmoa80ZmsSYynOinCF3zzqx5kLE6Eetj3GE=hRPCV5tXB-w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Mar 16, 2016 at 4:10 AM, Ashutosh Bapat <
> ashutosh.bapat@enterprisedb.com> wrote:
>> In 9.5, postgres_fdw allowed to prepare statements involving foreign
>> tables without an associated user mapping as long as planning did not
>> require the user mapping. Remember, planner would require user mapping in
>> case use_remote_estimate is ON for that foreign table. The user mapping
>> would be certainly required at the time of execution. So executing such a
>> prepared statement would throw error. If somebody created a user mapping
>> between prepare and execute, execute would not throw an error. A join can
>> be pushed down only when user mappings associated with the joining
>> relations are known and they match. But given the behavior of 9.5 we should
>> let the prepare succeed, even if the join can not be pushed down because of
>> unknown user mapping. Before this fix, the test was not letting the prepare
>> succeed, which is not compliant with 9.5.

> If a query against a single table with no user mapping is legal, I don't
> see why pushing down a join between two tables neither of which has a user
> mapping shouldn't also be legal.

The key point here is that Ashutosh is arguing on the basis of the
behavior of postgres_fdw, which is not representative of all FDWs.
The core code has no business assuming that all FDWs require user
mappings; file_fdw is a counterexample.

I think the behavior Robert suggests is just fine.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (18+ messages)  latest in thread

Message-ID: <19867.1458147169@sss.pgh.pa.us>
Permalink:  ../19867.1458147169@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19867.1458147169@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, ashutosh.bapat@enterprisedb.com, fujita.etsuro@lab.ntt.co.jp, andres@anarazel.de, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Only try to push down foreign joins if the user mapping OIDs mat
  In-Reply-To: <19867.1458147169@sss.pgh.pa.us>
  References: <E1aOrwD-0004Af-Rm@gemulon.postgresql.org> <20160312031502.lqtbqnqor4vji62k@alap3.anarazel.de> <CA+TgmoZqPKh-dx2HFGLc76RNV1mUBwj7O5imtSLkuw8xj8_8Lw@mail.gmail.com> <20160312194625.txlzu22xykgpu66n@alap3.anarazel.de> <56E6240E.5090301@lab.ntt.co.jp> <18299.1457923919@sss.pgh.pa.us> <CA+TgmoZaiM80TJySOhk6DR3fqHbZEELTuyVboL6MOtvFqKmJ6w@mail.gmail.com> <3221.1457975148@sss.pgh.pa.us> <CA+Tgmoa2tXRFo1_sBpAZu9J3OpGJr6J3EJ5AaxcxDLtNcs6SqA@mail.gmail.com> <CAFjFpRdnWjSM=s6mKx6mwXcMJr_z398ys1UeCV28_7qOAW0yhA@mail.gmail.com> <CA+TgmoaT7Q5H8SsCf1_xtgRcSGzYxSMMMj21okwt3ju6Y9Xb9A@mail.gmail.com> <CAFjFpRcGU+p7z99w6S0inMJcxPH02mtj3cWeYUDcz0txU1frLw@mail.gmail.com> <CA+Tgmoa80ZmsSYynOinCF3zzqx5kLE6Eetj3GE=hRPCV5tXB-w@mail.gmail.com> <19867.1458147169@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox