Re: Analyze plan of foreign data wrapper

From: Mathieu PUJOL <mathieu(dot)pujol(at)realfusio(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Analyze plan of foreign data wrapper
Date: 2018-06-29 14:56:26
Message-ID: CAH_OVQGUi3-0Ke85hcHzWLR6asjGTms5p3PuF+N0nk7pZzV+6g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
I understand that I should also use varno to check which table is
referenced by varattno. In case of Join, aggregation, etc. Sometimes I get
a number or INNER_VAR or OUTER_VAR.
I am lost on how i could resolve this.
I understand that OUTER_VAR/INNER_VAR are related to joins sub plans. Is
outer related to left plan and inner to right plan ? In this case varattno
is index of target list of subplan ?
When varno is an index how to retrieve table info ?
Regards
Mathieu

Le jeu. 28 juin 2018 à 23:17, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> a
écrit :

> Mathieu PUJOL wrote:
> > I'am writing a foreign data wrapper. To avoid returning data for a
> column that is not used, I parse 'targetlist' and 'qual' of the Plan.
> > I'am able to find Var nodes but I can't figure out how i could now if
> this node is related to a column my foreign table.
>
> For a Var v, v->varattno contains the attribute number of the column.
> That is the same as the attnum column in pg_attribute.
>
> If v->varattno == 0, it is a whole-row reference, like in
>
> SELECT mytab FROM mytab;
>
> Yours,
> Laurenz Albe
> --
> Cybertec | https://www.cybertec-postgresql.com
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tracy Babiasz 2018-06-29 14:58:07 CSV export bug?
Previous Message Magnus Hagander 2018-06-29 13:20:02 Re: Code of Conduct committee: call for volunteers