Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aOgrT-0003gx-Ro for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Jan 2016 07:19:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aOgrT-0001fy-2B for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Jan 2016 07:19:23 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aOgq8-0000Do-BK for pgsql-hackers@postgresql.org; Thu, 28 Jan 2016 07:18:00 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aOgq4-0006xu-2J for pgsql-hackers@postgresql.org; Thu, 28 Jan 2016 07:17:58 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id u0S7HpkG008315; Thu, 28 Jan 2016 16:17:51 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id E8DFE5F611; Thu, 28 Jan 2016 16:17:50 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id DB4545F594; Thu, 28 Jan 2016 16:17:50 +0900 (JST) Received: from [IPv6:::1] (unknown [129.60.241.75]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTP id D568F400305; Thu, 28 Jan 2016 16:17:50 +0900 (JST) Subject: Re: Minor code improvements to create_foreignscan_plan/ExecInitForeignScan References: <20160120220419.GA380317@alvherre.pgsql> <56A0B927.7050105@lab.ntt.co.jp> From: Etsuro Fujita Message-ID: <56A9C025.3050603@lab.ntt.co.jp> Date: Thu, 28 Jan 2016 16:15:49 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit To: Robert Haas Cc: Alvaro Herrera , Michael Paquier , PostgreSQL mailing lists X-TM-AS-MML: disable X-Pg-Spam-Score: -2.6 (--) 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 On 2016/01/28 12:13, Robert Haas wrote: > On Thu, Jan 21, 2016 at 5:55 AM, Etsuro Fujita > wrote: >> On 2016/01/21 7:04, Alvaro Herrera wrote: >>> Etsuro Fujita wrote: >>>> >>>> On second thought, I noticed that detecting whether we see a system >>>> column >>>> that way needs more cycles in cases where the reltargetlist and the >>>> restriction clauses don't contain any system columns. ISTM that such >>>> cases >>>> are rather common, so I'm inclined to keep that code as-is. >>> Ah, I see now what you did there. I was thinking you'd have the >>> foreach(restrictinfo) loop, then once the loop is complete scan the >>> bitmapset; not scan the bitmap set scan inside the other loop. >> Ah, I got to the point. I think that is a good idea. The additional cycles >> for the worst case are bounded and negligible. Please find attached an >> updated patch. > I don't think this is a good idea. Most of the time, no system > columns will be present, and we'll just be scanning the Bitmapset > twice rather than once. Sure, that doesn't take many extra cycles, > but if the point of all this is to micro-optimize this code, that > particular change is going in the wrong direction. I thought that is a good idea, considering the additional overhead is little, because that would be useful for some use-cases. But I think we need more discussions about that, so if there are no objections from Alvaro (or anyone), I'll leave that part as-is. 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