Re: Possible problem in Custom Scan API

From: Dmitry Ivanov <d(dot)ivanov(at)postgrespro(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dmitry Ivanov <d(dot)ivanov(at)postgrespro(dot)ru>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Possible problem in Custom Scan API
Date: 2017-04-11 18:33:15
Message-ID: 1ef85b46-1385-4810-bb80-97cd977da1d5@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-04-11 18:40:23 Why does logical replication launcher set application_name?
Previous Message Bruce Momjian 2017-04-11 18:23:46 Re: bumping HASH_VERSION to 3