Re: postgres_fdw: wrong results with self join + enable_nestloop off

Поиск
Список
Период
Сортировка
От Önder Kalacı
Тема Re: postgres_fdw: wrong results with self join + enable_nestloop off
Дата
Msg-id CACawEhWN=-Xhf9sqt22+AvZsNnwP5SQfDQm1Ug7he6E6cfxD7g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: postgres_fdw: wrong results with self join + enable_nestloop off  (Etsuro Fujita <etsuro.fujita@gmail.com>)
Ответы Re: postgres_fdw: wrong results with self join + enable_nestloop off  (Etsuro Fujita <etsuro.fujita@gmail.com>)
Список pgsql-hackers
Hi Etsuro,

Thanks for the response!
 
Maybe we could do so by leaving to extensions the decision whether
they replace joins with pseudoconstant clauses, but I am not sure that
that is a good idea, because that would require the authors to modify
and recompile their extensions to fix the issue... 

I think I cannot easily follow this argument. The decision to push down the join
(or not) doesn't seem to be related to calling set_join_pathlist_hook. It seems like the
extension should decide what to do with the hook. 

That seems the generic theme of the hooks that Postgres provides. For example, the extension
is allowed to even override the whole planner/executor, and there is no condition that would
prevent it from happening. In other words, an extension can easily return wrong results with the
wrong actions taken with the hooks, and that should be responsibility of the extension, not Postgres


I am not familiar with the Citus extension, but such pseudoconstant
clauses are handled within the Citus extension?


As I noted earlier, Citus relies on this hook for collecting information about all the joins that Postgres
knows about, there is nothing specific to pseudoconstants. Some parts of creating the (distributed) 
plan relies on the information gathered from this hook. So, if information about some of the joins 
are not passed to the extension, then the decisions that the extension gives are broken (and as a result
the queries are broken).

Thanks,
Onder 


  

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: dubious warning: FORMAT JSON has no effect for json and jsonb types
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: [PATCH] Add function to_oct