Function scan push-down using SQL/MED syntax - Mailing list pgsql-cluster-hackers

From Takahiro Itagaki
Subject Function scan push-down using SQL/MED syntax
Date
Msg-id 20100304135219.4D4A.52131E4D@oss.ntt.co.jp
Whole thread Raw
Responses Re: Function scan push-down using SQL/MED syntax  (Josh Berkus <josh@agliodbs.com>)
Re: Function scan push-down using SQL/MED syntax  (Hitoshi Harada <umi.tanuki@gmail.com>)
List pgsql-cluster-hackers
I'm working on SQL/MED foreign table for "Function scan push-down" item:
    http://wiki.postgresql.org/wiki/ClusterFeatures#Function_scan_push-down
The current research is described in:
    http://wiki.postgresql.org/wiki/SQL/MED
and the codes are in:
    http://repo.or.cz/w/pgsql-fdw.git

The present codes consist of two parts:
    1. Foreign table syntax, catalog, and connection manager in the core.
    2. contrib/postgresql_fdw extension module.

SQL/MED could take on some part of dblink and PL/Proxy. Also, it requires
the same issues with pgpool where to execute functions, local or remote.


The major part of the proposal is that table functions (SRF) should have
an ability to access ScanState during execution because ScanState has
filtering conditions. Foreign Data Wrappers can re-constract a SQL query
from the conditions and send the query to the external server.

The current design is very similar to "Executor node hook".
ExecXxxForeignScan() almost pass-through the processing to each FDW
routine. SQL-based FDWs can push-down the conditions to their foreign
servers. Also, plain data FDWs (including CSV-FDW) can give over
the filtering to the default executor.


Comments and suggestions are very welcome for the design and implementation.
There are also some known issues in the Open questions section.

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center


pgsql-cluster-hackers by date:

Previous
From: Takahiro Itagaki
Date:
Subject: Re: Spec discussion: Generalized Data Queue / Modification Trigger
Next
From: Josh Berkus
Date:
Subject: Re: Function scan push-down using SQL/MED syntax