Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 1E6651337999 for ; Tue, 29 Mar 2011 08:29:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 79167-02 for ; Tue, 29 Mar 2011 11:29:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f174.google.com (mail-iw0-f174.google.com [209.85.214.174]) by mail.postgresql.org (Postfix) with ESMTP id 71EC41337BE2 for ; Tue, 29 Mar 2011 08:29:09 -0300 (ADT) Received: by iwn34 with SMTP id 34so65315iwn.19 for ; Tue, 29 Mar 2011 04:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer; bh=NjJDIPXZe6N1hjxkIOow6GJvDbzw4WWnfYXXk4VrHuA=; b=xbyFYhUaE3Fj6TMBVIkj9xdkj7OqNk02qsgaoRX4Iu3uAoIYrvQKuIHDV8RduKxnEb UfcBHdQX92zghflAQUZOdPNXAy4BqcREHfNykiOp6MlopYqIaPYwuSpXloNXVfDPPBo7 owgMQ5fVj/dgRZzIZ4L7gTRX6GSDH3Menkd6Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=vgr0a6Sb8y734BUiaOnWxbkoTl3L9y2F9J3QD6UQYGdI1Ta2MeonvyayONE0FvSaEH rtkcu2TlNY1Tdli2LC98JHnKvTlwINMyXW4qkzU2q2IPrmScHDNYRV9prcfoARzrytF+ Vc/SAtVT5OYpFsd1nJqswuaaJbQ+orilDpA9o= Received: by 10.42.117.3 with SMTP id r3mr8001238icq.429.1301398149758; Tue, 29 Mar 2011 04:29:09 -0700 (PDT) Received: from [172.16.36.3] ([74.117.56.62]) by mx.google.com with ESMTPS id g4sm3443129ick.23.2011.03.29.04.29.03 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 29 Mar 2011 04:29:07 -0700 (PDT) Subject: Re: foreign data wrappers Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: Zheng Yang In-Reply-To: <4D8E0125.9060905@dunslane.net> Date: Tue, 29 Mar 2011 19:28:57 +0800 Cc: Shiv , Selena Deckelmann , Alvaro Herrera , Guillaume Lelarge , pgsql-students Content-Transfer-Encoding: quoted-printable Message-Id: <8DB4D3E9-DA21-45FD-A2A2-5C6D479AA565@gmail.com> References: <690867AB-C50B-4354-91D0-8A0811639C4C@gmail.com> <4D879CD0.5030803@dunslane.net> <3EF9E4CC-CF42-4B45-86FF-4CB9D46D7442@gmail.com> <4D8AF8C2.3000007@lelarge.info> <4ACC318A-1B6F-49A5-9B02-49EEAF7B97C7@gmail.com> <1300985156-sup-3058@alvh.no-ip.org> <47676.208.91.122.102.1300985713.squirrel@dunslane.net> <603812A0-F464-44AE-8A90-DF9BD1DC2DB9@gmail.com> <4D8E0125.9060905@dunslane.net> To: Andrew Dunstan X-Mailer: Apple Mail (2.1082) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201103/37 X-Sequence-Number: 178 Hi guys, >>=20 >> I've briefly gone through the slides. Regarding the 6 callbacks, is = that correct to say that a full table scan will always be performed = irregardless of the sql statement, >> the FDW is blind to the sql query performed, right? >=20 > 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. >=20 Regarding the previous flickr example, I'm wondering how this 'free text = search' function can be done if the FDW is blind to 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' .=20 The problem is that there are a huge number of photos in flickr server = and retrieving them sequentially is not realistic.=20 Any ideas on how this can be done? ZY=