From: Tom Lane <tgl@sss.pgh.pa.us>
To: 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 15:47:50 -0400
Message-ID: <367.1491940070@sss.pgh.pa.us> (raw)
In-Reply-To: <1ef85b46-1385-4810-bb80-97cd977da1d5@postgrespro.ru>
References: <e29ddd30-8ef9-4da5-a50b-2bb7b8c7198d@postgrespro.ru>
<20021.1491933424@sss.pgh.pa.us>
<1ef85b46-1385-4810-bb80-97cd977da1d5@postgrespro.ru>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Dmitry Ivanov <d.ivanov@postgrespro.ru> writes:
> 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.
You haven't really convinced me that anything is wrong there. The append
plan's tlist isn't going to contain unwanted variables either.
Reading between the lines, I think the problem may be that you're not
being careful about how you set up custom_scan_tlist. But since the
core code has zero involvement in that decision, it's hard to see why
it would be a core code bug.
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
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, d.ivanov@postgrespro.ru
Subject: Re: Possible problem in Custom Scan API
In-Reply-To: <367.1491940070@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