pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Minor code improvements to create_foreignscan_plan/ExecInitForeignScan
Date: Wed, 22 Jul 2015 15:25:12 +0900
Message-ID: <55AF3748.9080901@lab.ntt.co.jp> (raw)
In-Reply-To: <CAKJS1f8EOCn+3GhzdVbRD74s=Jf9JpFGxgW6D_P1BuVGb7vaXw@mail.gmail.com>
References: <559F9323.4080403@lab.ntt.co.jp>
	<CAKJS1f8EOCn+3GhzdVbRD74s=Jf9JpFGxgW6D_P1BuVGb7vaXw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 2015/07/10 21:59, David Rowley wrote:
> On 10 July 2015 at 21:40, Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp
> <mailto:fujita.etsuro@lab.ntt.co.jp>> wrote:
>
>     To save cycles, I modified create_foreignscan_plan so that it detects
>     whether any system columns are requested if scanning a base relation.
>     Also, I revised other code there a little bit.
>
>     For ExecInitForeignScan, I simplified the code there to determine the
>     scan tuple type, whith seems to me complex beyound necessity.  Maybe
>     that might be nitpicking, though.

For the latter, I misunderstood that the latest foreign-join pushdown 
patch allows fdw_scan_tlist to be set to a targetlist even for simple 
foreign table scans.  Sorry for that, but I have a concern about that. 
I'd like to mention it in a new thread later.

> I just glanced at this and noticed that the method for determining if
> there's any system columns could be made a bit nicer.
>
> /* Now, are any system columns requested from rel? */
> scan_plan->fsSystemCol = false;
> for (i = FirstLowInvalidHeapAttributeNumber + 1; i < 0; i++)
> {
> if (bms_is_member(i - FirstLowInvalidHeapAttributeNumber, attrs_used))
> {
> scan_plan->fsSystemCol = true;
> break;
> }
> }
>
> I think could just be written as:
> /* Now, are any system columns requested from rel? */
> if (!bms_is_empty(attrs_used) &&
> bms_next_member(attrs_used, -1) < -FirstLowInvalidHeapAttributeNumber)
> scan_plan->fsSystemCol = true;
> else
> scan_plan->fsSystemCol = false;
>
> I know you didn't change this, but just thought I'd mention it while
> there's an opportunity to fix it.

Good catch!

Will update the patch (and drop the ExecInitForeignScan part from the 
patch).

Sorry for the delay.

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



view thread (22+ messages)  latest in thread

Message-ID: <55AF3748.9080901@lab.ntt.co.jp>
Permalink:  ../55AF3748.9080901@lab.ntt.co.jp/
Also on:    postgresql.org/message-id/55AF3748.9080901@lab.ntt.co.jp

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: fujita.etsuro@lab.ntt.co.jp, david.rowley@2ndquadrant.com
  Subject: Re: Minor code improvements to create_foreignscan_plan/ExecInitForeignScan
  In-Reply-To: <55AF3748.9080901@lab.ntt.co.jp>
  References: <559F9323.4080403@lab.ntt.co.jp> <CAKJS1f8EOCn+3GhzdVbRD74s=Jf9JpFGxgW6D_P1BuVGb7vaXw@mail.gmail.com> <55AF3748.9080901@lab.ntt.co.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox