Enhancing FDW functionality for PostgreSQL GSoC2011

From PostgreSQL wiki
Revision as of 15:56, 13 June 2011 by Nicolas.barbier (talk | contribs) (Shedule: Fixed a type: S+c+hedule)
Jump to: navigation, search


PostgreSQL foreign-data wrapper (FDW) functionality is still very rudimentary: there is no support for parsing complex quals and joined query is not supported by current version of FDW API. My plan for this year's GSoC is to firstly implement a CouchDB FDW, followed by developing a generic ODBC FDW for windows and one of the *nix platform (probably on Ubuntu), last but not least to add join pushdown support for FDW API (If time allows).



In general, the main work of developing a FDW is to implement the 6 callback functions:

       * PlanForeignScan
       * ExplainForeignScan
       * BeginForeignScan
       * IterateForeignScan
       * ReScanForeignScan
       * EndForeignScan

I will be using quals property inside ScanState->Plan node to extract the condition in WHERE clause and using libcurl and libjson to call and parse relative services provided by CouchDB RESTful/JSON API, based on the qualifications extracted from the SELECT statement.

ODBC FDW & Complex quals pushdown

Similar manner will be used to create a cross platform FDW that can access databases that have implemented ODBC interface (Windows driver manager and iODBC driver manager). Complex quals with UDFs will need a mapping on a per DBMS basis.

Join pushdown

Enable FDW to open several foreign tables at the same time to perform join operation. The conditions for join and WHERE qualifications will be pushed down to the foreign side.


1. Late April 2011 (Week 1): Research & reading mysql_fdw and redis_fdw

2. May 2011 (Week 2~5): Warm up and implement CouchDB FDW. Implement ODBC FDW for iODBC driver on one of the linux distribution.

3. June 2011 (Week 6~9): Implement ODBC FDW for Microsoft driver on Windows. Implement complex quals pushdown for ODBC FDW.

4. July 2011 (Week 10~13): Finish complex quals pushdown feature.

5. August 2011 (Week 14~16): Documentation and Testing.