Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coFCj-00089l-7D for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Mar 2017 20:07:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1coFCi-0007w8-LK for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Mar 2017 20:07:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1coFCh-0007vy-Tq for pgsql-hackers@postgresql.org; Wed, 15 Mar 2017 20:07:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1coFCg-0002fQ-0Z for pgsql-hackers@postgresql.org; Wed, 15 Mar 2017 20:07:27 +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 v2FK7EG8004543; Wed, 15 Mar 2017 16:07:14 -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: <20170315195838.2dqr2v674u4qwxw4@alap3.anarazel.de> References: <20170307030137.lpo4japv5oqgbqpz@alap3.anarazel.de> <2090fd00-4dec-7b42-f700-64308958504c@2ndquadrant.com> <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> Comments: In-reply-to Andres Freund message dated "Wed, 15 Mar 2017 12:58:38 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4541.1489608434.1@sss.pgh.pa.us> Date: Wed, 15 Mar 2017 16:07:14 -0400 Message-ID: <4542.1489608434@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 15:41:22 -0400, Tom Lane wrote: >> Color me dubious. Which specific other places have you got in mind, and >> do they have expression trees at hand that would tell them which columns >> they really need to pull out? > I was thinking of execGrouping.c's execTuplesMatch(), > TupleHashTableHash() (and unequal, but doubt that matters > performancewise). There's also nodeHash.c's ExecHashGetValue(), but I > think that'd possibly better fixed differently. The execGrouping.c functions don't have access to an expression tree instructing them which columns to pull out of the tuple, so I fail to see how get_last_attnums() would be of any use to them. 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. 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