Re: PostgreSQL FDW update

Lists: pgsql-hackers
From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)jp>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: PostgreSQL FDW update
Date: 2011-02-08 08:52:16
Message-ID: 4D510440.80807@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I needed something to test the FDW API patch with, and didn't want to
get involved in the COPY API changes, and also wanted to have something
that needs real connection management and can push down quals. So I
updated the postgresql_fdw patch to work with the latest FDW patch.

Here. It's a bit of a mess, but it works for simple queries..

It requires a small change to the FDW api
(fdw-api-add-serverid-userid.patch). I added server oid and user oid
fields to the FdwPlan - that seems like basic information that most
FDW's will need, so it seems awkward to require the FDW to wrap them in
Const nodes and a List.

These are also available in my git repository at
git://git.postgresql.org/git/users/heikki/postgres.git, branches fdw2
and postgresql_fdw.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Attachment Content-Type Size
postfresql_fdw-reworked-api-1.patch text/x-diff 24.6 KB
fdw-api-add-serverid-userid-1.patch text/x-diff 24.0 KB

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)jp>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL FDW update
Date: 2011-02-10 13:12:02
Message-ID: AANLkTinqujZRkOgeFg0WjwWR_vQPLi8bbN5bAM6kRdwj@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Feb 8, 2011 at 3:52 AM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> I needed something to test the FDW API patch with, and didn't want to get
> involved in the COPY API changes, and also wanted to have something that
> needs real connection management and can push down quals. So I updated the
> postgresql_fdw patch to work with the latest FDW patch.
>
> Here. It's a bit of a mess, but it works for simple queries..
>
> It requires a small change to the FDW api
> (fdw-api-add-serverid-userid.patch). I added server oid and user oid fields
> to the FdwPlan - that seems like basic information that most FDW's will
> need, so it seems awkward to require the FDW to wrap them in Const nodes and
> a List.
>
> These are also available in my git repository at
> git://git.postgresql.org/git/users/heikki/postgres.git, branches fdw2 and
> postgresql_fdw.

So how close are we to getting the core support committed?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)jp>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL FDW update
Date: 2011-02-21 15:31:12
Message-ID: 13785.1298302272@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> I needed something to test the FDW API patch with, and didn't want to
> get involved in the COPY API changes, and also wanted to have something
> that needs real connection management and can push down quals. So I
> updated the postgresql_fdw patch to work with the latest FDW patch.

> Here. It's a bit of a mess, but it works for simple queries..

I'm going to set this CF item back to Waiting on Author, because (a)
there doesn't seem to be an actual concrete patch presented at the
moment, only a stack of hard-to-follow deltas, and (b) the patch
certainly needs updates for the extension mechanism and committed
FDW API anyway.

> It requires a small change to the FDW api
> (fdw-api-add-serverid-userid.patch). I added server oid and user oid
> fields to the FdwPlan - that seems like basic information that most
> FDW's will need, so it seems awkward to require the FDW to wrap them in
> Const nodes and a List.

FYI, I removed those fields from the committed API patch. I don't
think it's a good idea to cache potentially-changeable things in a
plan node when you can perfectly well fetch them at runtime. Caching
user OID is flat wrong anyway, as there's no guarantee that a cached
plan will be executed under the same userid it was made with.

regards, tom lane


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)jp>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL FDW update
Date: 2011-02-22 16:33:25
Message-ID: AANLkTik6EwaO+gMSkX4pwHx0Ayn8K_fgNOdR0ntLHeyT@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Feb 21, 2011 at 10:31 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
>> I needed something to test the FDW API patch with, and didn't want to
>> get involved in the COPY API changes, and also wanted to have something
>> that needs real connection management and can push down quals. So I
>> updated the postgresql_fdw patch to work with the latest FDW patch.
>
>> Here. It's a bit of a mess, but it works for simple queries..
>
> I'm going to set this CF item back to Waiting on Author, because (a)
> there doesn't seem to be an actual concrete patch presented at the
> moment, only a stack of hard-to-follow deltas, and (b) the patch
> certainly needs updates for the extension mechanism and committed
> FDW API anyway.

Is anyone actually working on a new version of this patch sufficiently
rapidly that we can expect a new version in the next day or two?

If not, I think we mark this one Returned with Feedback and revisit it for 9.2.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)jp>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL FDW update
Date: 2011-02-23 11:30:05
Message-ID: 20110223203002.F21C.6989961C@metrosystems.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On Tue, 22 Feb 2011 11:33:25 -0500
Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> Is anyone actually working on a new version of this patch sufficiently
> rapidly that we can expect a new version in the next day or two?
>
> If not, I think we mark this one Returned with Feedback and revisit it for 9.2.

I'm working on it.

Fixes for new FDW API have been done, but there are some problems in
SQL generation codes, such as SELECT clause optimization (omitting
unused column from SELECT clause). It would take a while, but I'll
post revised version of the patch tomorrow.

Regards,
--
Shigeru Hanada


From: Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)jp>
To: Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)jp>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL FDW update
Date: 2011-02-24 13:13:15
Message-ID: 20110224221314.F228.6989961C@metrosystems.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On Wed, 23 Feb 2011 20:30:05 +0900
Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)jp> wrote:

>
> On Tue, 22 Feb 2011 11:33:25 -0500
> Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> > Is anyone actually working on a new version of this patch sufficiently
> > rapidly that we can expect a new version in the next day or two?
> >
> > If not, I think we mark this one Returned with Feedback and revisit it for 9.2.
>
> I'm working on it.
>
> Fixes for new FDW API have been done, but there are some problems in
> SQL generation codes, such as SELECT clause optimization (omitting
> unused column from SELECT clause). It would take a while, but I'll
> post revised version of the patch tomorrow.

Attached is a revised version of postgresql_fdw patch. I started from
Heikki's latest patch, and modified some points:

1) use new FDW API
2) use EXTENSION framework
3) SELECT clause optimization (use NULL for unused columns)
4) show remote query in EXPLAIN output

WHERE clause pushdown was implemented in Heikki's version, so I didn't
touch around it. Now I'm working on cost estimation and connection
management, but they would need some more work.

--
Shigeru Hanada

Attachment Content-Type Size
20110224-postgresql_fdw.patch application/octet-stream 48.5 KB

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)jp>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL FDW update
Date: 2011-02-24 14:06:42
Message-ID: AANLkTikRC9frRBc9ojAtMq9M5dAE9nKK5UBk8nvo4wn=@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Feb 24, 2011 at 8:13 AM, Shigeru HANADA
<hanada(at)metrosystems(dot)co(dot)jp> wrote:
>
> On Wed, 23 Feb 2011 20:30:05 +0900
> Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)jp> wrote:
>
>>
>> On Tue, 22 Feb 2011 11:33:25 -0500
>> Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> > Is anyone actually working on a new version of this patch sufficiently
>> > rapidly that we can expect a new version in the next day or two?
>> >
>> > If not, I think we mark this one Returned with Feedback and revisit it for 9.2.
>>
>> I'm working on it.
>>
>> Fixes for new FDW API have been done, but there are some problems in
>> SQL generation codes, such as SELECT clause optimization (omitting
>> unused column from SELECT clause).  It would take a while, but I'll
>> post revised version of the patch tomorrow.
>
> Attached is a revised version of postgresql_fdw patch.  I started from
> Heikki's latest patch, and modified some points:
>
> 1) use new FDW API
> 2) use EXTENSION framework
> 3) SELECT clause optimization (use NULL for unused columns)
> 4) show remote query in EXPLAIN output
>
> WHERE clause pushdown was implemented in Heikki's version, so I didn't
> touch around it.  Now I'm working on cost estimation and connection
> management, but they would need some more work.

So this is still work-in-progress? When do you expect a final version?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)jp>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL FDW update
Date: 2011-02-26 05:07:40
Message-ID: AANLkTi=T8y86nrDk9BOomwTzzY=0D5ygNfqSd18J3pvm@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Feb 24, 2011 at 9:06 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Thu, Feb 24, 2011 at 8:13 AM, Shigeru HANADA
> <hanada(at)metrosystems(dot)co(dot)jp> wrote:
>>
>> On Wed, 23 Feb 2011 20:30:05 +0900
>> Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)jp> wrote:
>>
>>>
>>> On Tue, 22 Feb 2011 11:33:25 -0500
>>> Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>> > Is anyone actually working on a new version of this patch sufficiently
>>> > rapidly that we can expect a new version in the next day or two?
>>> >
>>> > If not, I think we mark this one Returned with Feedback and revisit it for 9.2.
>>>
>>> I'm working on it.
>>>
>>> Fixes for new FDW API have been done, but there are some problems in
>>> SQL generation codes, such as SELECT clause optimization (omitting
>>> unused column from SELECT clause).  It would take a while, but I'll
>>> post revised version of the patch tomorrow.
>>
>> Attached is a revised version of postgresql_fdw patch.  I started from
>> Heikki's latest patch, and modified some points:
>>
>> 1) use new FDW API
>> 2) use EXTENSION framework
>> 3) SELECT clause optimization (use NULL for unused columns)
>> 4) show remote query in EXPLAIN output
>>
>> WHERE clause pushdown was implemented in Heikki's version, so I didn't
>> touch around it.  Now I'm working on cost estimation and connection
>> management, but they would need some more work.
>
> So this is still work-in-progress?  When do you expect a final version?

Since it sounds like this still needs more work, I'm going to mark it
Returned with Feedback. I hope we integrate this during the 9.2
cycle.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company