Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WT66c-0004PQ-U5 for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Mar 2014 08:56:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WT66c-0001b3-Cj for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Mar 2014 08:56:10 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WT66Z-0001as-K8 for pgsql-hackers@postgresql.org; Thu, 27 Mar 2014 08:56:07 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WT66R-0003UB-UN for pgsql-hackers@postgresql.org; Thu, 27 Mar 2014 08:56:06 +0000 Received: from mfs6.rdh.ecl.ntt.co.jp (mfs6.rdh.ecl.ntt.co.jp [129.60.39.149]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id s2R8tvjf025278; Thu, 27 Mar 2014 17:55:57 +0900 Received: from mfs6.rdh.ecl.ntt.co.jp (localhost.localdomain [127.0.0.1]) by mfs6.rdh.ecl.ntt.co.jp (Postfix) with ESMTP id 5E23BE015B; Thu, 27 Mar 2014 17:55:57 +0900 (JST) Received: from imail3.m.ecl.ntt.co.jp (imail3.m.ecl.ntt.co.jp [129.60.5.248]) by mfs6.rdh.ecl.ntt.co.jp (Postfix) with ESMTP id 52E1EE0141; Thu, 27 Mar 2014 17:55:57 +0900 (JST) Received: from [129.60.241.149] ([129.60.241.149]) by imail3.m.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id s2R8tulV013285; Thu, 27 Mar 2014 17:55:57 +0900 Message-ID: <5333E78D.2070909@lab.ntt.co.jp> Date: Thu, 27 Mar 2014 17:55:41 +0900 From: Etsuro Fujita User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Kyotaro HORIGUCHI CC: shigeru.hanada@gmail.com, pgsql-hackers@postgresql.org Subject: Re: inherit support for foreign tables References: <532F8EC1.6020401@lab.ntt.co.jp> <20140326.171454.142890940.horiguchi.kyotaro@lab.ntt.co.jp> <533383BF.1050004@lab.ntt.co.jp> <20140327.170917.91664276.horiguchi.kyotaro@lab.ntt.co.jp> In-Reply-To: <20140327.170917.91664276.horiguchi.kyotaro@lab.ntt.co.jp> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-TM-AS-MML: No X-Pg-Spam-Score: -2.3 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Hi Horiguchi-san, (2014/03/27 17:09), Kyotaro HORIGUCHI wrote: >>>> analyze.c: In function ‘acquire_inherited_sample_rows’: >>>> analyze.c:1461: warning: unused variable ‘saved_rel’ >> >> I've fixed this in the latest version (v8) of the patch. > > Mmm. sorry. I missed v8 patch. Then I had a look on that and have > a question. Thank you for the review! > You've added a check for relkind of baserel of the foreign path > to be reparameterized. If this should be an assertion - not a > conditional branch -, it would be better to put the assertion in > create_foreignscan_path instead of there. > > ===== > --- a/src/backend/optimizer/util/pathnode.c > +++ b/src/backend/optimizer/util/pathnode.c > @@ -1723,6 +1723,7 @@ create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel, > List *fdw_private) > { > ForeignPath *pathnode = makeNode(ForeignPath); > + Assert(rel->rtekind == RTE_RELATION); > > pathnode->path.pathtype = T_ForeignScan; > pathnode->path.parent = rel; > ===== Maybe I'm missing the point, but I don't think it'd be better to put the assertion in create_foreignscan_path(). And I think it'd be the caller' responsiblity to ensure that equality, as any other pathnode creation routine for a baserel in pathnode.c assumes that equality. >>> And for file-fdw, you made a change to re-create foreignscan node >>> instead of the previous copy-and-modify. Is the reason you did it >>> that you considered the cost of 're-checking whether to >>> selectively perform binary conversion' is low enough? Or other >>> reasons? >> >> The reason is that we get the result of the recheck from >> path->fdw_private. Sorry, I'd forgotten it. So, I modified the code to >> simply call create_foreignscan_path(). > > Anyway you new code seems closer to the basics and the gain by > the previous optimization don't seem to be significant.. Yeah, that's true. I have to admit that the previous optimization is nonsense. Thanks, Best regards, Etsuro Fujita -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers