pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitry Ivanov <d.ivanov@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Dmitry Ivanov <d.ivanov@postgrespro.ru>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Possible problem in Custom Scan API
Date: Tue, 11 Apr 2017 21:33:15 +0300
Message-ID: <1ef85b46-1385-4810-bb80-97cd977da1d5@postgrespro.ru> (raw)
In-Reply-To: <20021.1491933424@sss.pgh.pa.us>
References: <e29ddd30-8ef9-4da5-a50b-2bb7b8c7198d@postgrespro.ru>
	<20021.1491933424@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Tom Lane wrote:
> Uh, why would you see that?  The planner would never generate an
> IndexOnlyScan in the first place if the query required any columns
> not available from the index.

True, but as you can see, create_append_plan() produces its own targetlist:

static Plan *
create_append_plan(PlannerInfo *root, AppendPath *best_path)
{
	Append	   *plan;
	List	   *tlist = build_path_tlist(root, &best_path->path);
	...

If we replace Append with some custom node, the plan will instantly become 
invalid (it won't be be able to build a projection from 'custom_scan_tlist' 
to 'targetlist'). However, this doesn't mean that it's unable to produce 
the same result.


-- 
Dmitry Ivanov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company


-- 
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 (12+ messages)  latest in thread

Message-ID: <1ef85b46-1385-4810-bb80-97cd977da1d5@postgrespro.ru>
Permalink:  ../1ef85b46-1385-4810-bb80-97cd977da1d5@postgrespro.ru/
Also on:    postgresql.org/message-id/1ef85b46-1385-4810-bb80-97cd977da1d5@postgrespro.ru

 · 

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: d.ivanov@postgrespro.ru, tgl@sss.pgh.pa.us
  Subject: Re: Possible problem in Custom Scan API
  In-Reply-To: <1ef85b46-1385-4810-bb80-97cd977da1d5@postgrespro.ru>

* 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