Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coGaA-0004UO-KZ for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Mar 2017 21:35:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1coGaA-0004D4-79 for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Mar 2017 21:35:46 +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_2) (envelope-from ) id 1coGYg-00017r-Mz for pgsql-hackers@postgresql.org; Wed, 15 Mar 2017 21:34:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1coGYZ-0000Pk-P9 for pgsql-hackers@postgresql.org; Wed, 15 Mar 2017 21:34:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v2FLXkQ2007584; Wed, 15 Mar 2017 17:33:46 -0400 From: Tom Lane To: Andres Freund cc: pgsql-hackers@postgresql.org, Heikki Linnakangas , Tomas Vondra Subject: Re: WIP: Faster Expression Processing v4 In-reply-to: <20170315205732.bwb2wh5o5ix2vv4b@alap3.anarazel.de> References: <20170313080351.4g5oubxcj4xj5y7t@alap3.anarazel.de> <20170314065259.ffef4tfhgbsaieoe@alap3.anarazel.de> <69b7bb0e-8dab-3d39-1a89-3c6ab6409f64@iki.fi> <20170314224706.nxvtapenky6eom3z@alap3.anarazel.de> <3086.1489606408@sss.pgh.pa.us> <855716B2-7522-4C79-A50E-2EB8E609764F@anarazel.de> <3401.1489606882@sss.pgh.pa.us> <20170315195838.2dqr2v674u4qwxw4@alap3.anarazel.de> <4542.1489608434@sss.pgh.pa.us> <20170315205732.bwb2wh5o5ix2vv4b@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Wed, 15 Mar 2017 13:57:32 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7582.1489613626.1@sss.pgh.pa.us> Date: Wed, 15 Mar 2017 17:33:46 -0400 Message-ID: <7583.1489613626@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) 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 Andres Freund writes: > On 2017-03-15 16:07:14 -0400, Tom Lane wrote: >> As for ExecHashGetHashValue, it's most likely going to be working from >> virtual tuples passed up to the join, which won't benefit from >> predetermination of the last column to be accessed. The >> tuple-deconstruction would have happened while projecting in the scan >> node below. > I think the physical tuple stuff commonly thwarts that argument? On > master for tpch's Q5 you can e.g. see the following profile (master): Hmmm ... I think you're mistaken in fingering the physical-tuple optimization per se, but maybe skipping ExecProject at the scan level would cause this result? I've thought for some time that it was dumb to have the executor reverse-engineering this info at plan startup anyway. We could make the planner mark each table scan node with the highest column number that the plan will access, and use that to drive a slot_getsomeattrs call in advance of any access to tuple contents. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers