Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZWexx-0006rc-CW for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Sep 2015 06:22:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZWexw-00064c-CQ for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Sep 2015 06:22:44 +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 1ZWewd-0004cC-Fi for pgsql-hackers@postgresql.org; Tue, 01 Sep 2015 06:21:23 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZWewW-0003hC-At for pgsql-hackers@postgresql.org; Tue, 01 Sep 2015 06:21:22 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id t816L3DZ022205; Tue, 1 Sep 2015 15:21:03 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 2B6FB5F631; Tue, 1 Sep 2015 15:21:03 +0900 (JST) Received: from imail3.m.ecl.ntt.co.jp (imail3.m.ecl.ntt.co.jp [129.60.5.248]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 1E0865F612; Tue, 1 Sep 2015 15:21:03 +0900 (JST) Received: from [129.60.241.75] ([129.60.241.75]) by imail3.m.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id t816L2DB001130; Tue, 1 Sep 2015 15:21:03 +0900 Message-ID: <55E543A0.8060804@lab.ntt.co.jp> Date: Tue, 01 Sep 2015 15:20:16 +0900 From: Etsuro Fujita User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: David Rowley CC: PostgreSQL-development Subject: Re: Minor code improvements to create_foreignscan_plan/ExecInitForeignScan References: <559F9323.4080403@lab.ntt.co.jp> <55AF3748.9080901@lab.ntt.co.jp> <55E035F9.1030008@lab.ntt.co.jp> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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 2015/08/30 13:06, David Rowley wrote: > It's likely not worth changing if there's cases when it'll be slower, > but curiosity got the better of me and I wondered how extreme a case it > would take to actually see a slowdown, and per my benchmark results the > first used column would have to be about attnum 500. > I used the attached to benchmark. has_system_columns is the current > method, has_system_columns2 has my changes. Lines are prefixed by the > position where the first (and only) attnum appears in the bitmap set. > 1 has_system_columns complete in 1.196000 > 1 has_system_columns2 complete in 0.170000 > 2 has_system_columns complete in 1.198000 > 2 has_system_columns2 complete in 0.167000 > 4 has_system_columns complete in 1.197000 > 4 has_system_columns2 complete in 0.170000 > 8 has_system_columns complete in 1.206000 > 8 has_system_columns2 complete in 0.203000 > 16 has_system_columns complete in 1.202000 > 16 has_system_columns2 complete in 0.237000 > 32 has_system_columns complete in 1.206000 > 32 has_system_columns2 complete in 0.232000 > 64 has_system_columns complete in 1.207000 > 64 has_system_columns2 complete in 0.268000 > 128 has_system_columns complete in 1.205000 > 128 has_system_columns2 complete in 0.368000 > 256 has_system_columns complete in 1.203000 > 256 has_system_columns2 complete in 0.780000 > 512 has_system_columns complete in 1.202000 > 512 has_system_columns2 complete in 1.302000 > 1024 has_system_columns complete in 1.199000 > 1024 has_system_columns2 complete in 3.539000 > So, for what it's worth, could be 6 times faster for an "average" sized > table, but hey, we're talking nanoseconds anyway... That's interesting. But ISTM that that needs more discussion, so I'd like to leave the method as-is at least for now. Thanks for the experiment! 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