Re: foreign data wrappers - Mailing list pgsql-students

From Andrew Dunstan
Subject Re: foreign data wrappers
Date
Msg-id 4D92098D.6040409@dunslane.net
Whole thread Raw
In response to Re: foreign data wrappers  (Guillaume Lelarge <guillaume@lelarge.info>)
Responses Re: foreign data wrappers  (Guillaume Lelarge <guillaume@lelarge.info>)
List pgsql-students

On 03/29/2011 11:48 AM, Guillaume Lelarge wrote:
> Le 29/03/2011 13:28, Zheng Yang a écrit :
>> Hi guys,
>>
>>>> I've briefly gone through the slides. Regarding the 6 callbacks, is that correct to say that a full table scan
willalways be performed irregardless of the sql statement, 
>>>> the FDW is blind to the sql query performed, right?
>>> Yes, fairly much. If the feed is large you need some way to pass a limit to the foreign side, possibly via table
options.I'm fairly sure you won't be able to get it via the SELECT statement. 
>>>
>>
>> Regarding the previous flickr example, I'm wondering how this 'free text search' function can be done if the FDW is
blindto the SELECT statement. 
>>
>> For instance, the following query is to retrieve a photo relevant to 'panda':
>>
>>     SELECT photo FROM flickr_table WHERE search LIKE '%panda%';
>>
>> In this case, the FDW can only open a connection to flickr web service and return the next 'row' .
>> The problem is that there are a huge number of photos in flickr server and retrieving them sequentially is not
realistic.
>> Any ideas on how this can be done?
>>
> It probably means that flickr is not a good example of a nice fdw.


Neither of you are being very creative. As I mentioned above, you need
to embed this sort of stuff in table options.

so you would have something like:

    create foreign table panda_flickr (photo bytea, ...)
         server flickr_server
         options (searchterm 'panda', maxrows '50');
    select photo from panda_flickr;


cheers

andrew

pgsql-students by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: foreign data wrappers
Next
From: Guillaume Lelarge
Date:
Subject: Re: foreign data wrappers