Re: FDW / list of needed columns, WHERE conditions (in PlanForeignScan)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: FDW / list of needed columns, WHERE conditions (in PlanForeignScan)
Дата
Msg-id 17388.1338350512@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: FDW / list of needed columns, WHERE conditions (in PlanForeignScan)  (Tomas Vondra <tv@fuzzy.cz>)
Список pgsql-hackers
Tomas Vondra <tv@fuzzy.cz> writes:
> Do I need to return only the data in rel->reltargetlist, or should I
> return all the columns (including those in rel->baserestrictinfo)?

> Because AFAIK PostgreSQL will recheck the conditions on the data
> returned from FDW and if I only return the attributes from the
> reltargetlist, the conditions will evaluate to FALSE. Can I prevent the
> recheck somehow e.g. by deleting it from baserestrictinfo?

In 9.1, the FDW doesn't have any control over that, so yeah you have to
include all those columns in the constructed scan tuples.  We rejiggered
this in 9.2 so that the FDW could control which baserestrictinfo quals
are evaluated that way.  (Of course, it's up to you to be sure you do
somehow check any conditions you remove from the qual list.)

> Also, how is baserestrictinfo related to PlanState.quals? Actually what
> are 'qual conditions'? I see 'qual' is a list of conditions connected by
> AND, but I'm not sure what a 'qual' means. Is that equality?

It's just planner slang for a WHERE condition.  The List structure
corresponds to top-level AND structure in WHERE, but otherwise the
elements correspond directly to WHERE expressions.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: hash index concurrency
Следующее
От: Tom Lane
Дата:
Сообщение: Re: hash index concurrency