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