pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org, Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Subject: Re: WIP: Faster Expression Processing v4
Date: Wed, 15 Mar 2017 18:48:28 -0400
Message-ID: <10199.1489618108@sss.pgh.pa.us> (raw)
In-Reply-To: <20170315222236.dw762ndavazinau4@alap3.anarazel.de>
References: <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>
	<7583.1489613626@sss.pgh.pa.us>
	<20170315220610.wx6pzmsbdjf5a7gs@alap3.anarazel.de>
	<9137.1489616217@sss.pgh.pa.us>
	<20170315222236.dw762ndavazinau4@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Andres Freund <andres@anarazel.de> writes:
> On 2017-03-15 18:16:57 -0400, Tom Lane wrote:
>> [ scratches head... ]  What deforming logic do you think I'm proposing
>> removing?

> I thought you were suggesting that we don't do the get_last_attnums (and
> inlined version in the isSimpleVar case) at execution time anymore,
> instead relying on logic in the planner to know how much to deform ahead
> of time.  Then we'd do slot_getsomeattrs in the appropriate places.  But
> I understood you suggesting to do so only in scan nodes - which doesn't
> seem sufficient, due to the use of materialized / minimal tuples in
> other types of nodes.  Did I misunderstand?

We would need to do it anywhere that we might be projecting from a
materialized tuple, I suppose.  From the planner's standpoint it would be
about as easy to do this for all plan nodes as only selected ones.

Anyway the core point here seems to be that skipping ExecProject misses a
bet because the underlying tuple doesn't get disassembled.  A quick-hack
way of seeing if this helps might be to do slot_getallattrs in the places
where we skip ExecProject.  I'm not sure we'd want that as a permanent
solution, because it's possible that it extracts columns not actually
needed, but it should at least move the hotspot in your example case.

			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



view thread (107+ messages)  latest in thread

Message-ID: <10199.1489618108@sss.pgh.pa.us>
Permalink:  ../10199.1489618108@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10199.1489618108@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, hlinnaka@iki.fi, tomas.vondra@2ndquadrant.com
  Subject: Re: WIP: Faster Expression Processing v4
  In-Reply-To: <10199.1489618108@sss.pgh.pa.us>

* 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