On 2019/01/15 10:46, Amit Langote wrote: > On 2019/01/11 20:04, Etsuro Fujita wrote: >> One thing I intended in that commit was to set the flag to false for >> partitioned tables contained in inheritance trees where the top parent is >> a UNION ALL subquery, because we don't consider PWJ for those tables. >> Actually we wouldn't need to care about that, because we don't do PWJ for >> those tables regardless of what the flag is set, but I think that would >> make the code a bit cleaner. > > Yeah, we wouldn't do partitionwise join between partitioned tables that > are under UNION ALL. > >> However, what you proposed here as-is would >> not keep that behavior, because rel->part_scheme is created for those >> tables as well > > It'd be easy to prevent set consider_partitionwise_join to false in that > case as:
Oops, I meant to say: It'd be easy to prevent setting consider_partitionwise_join in that case as: > > + rel->consider_partitionwise_join = (rel->part_scheme != NULL && > + (parent == NULL || > + parent->rtekind != RTE_SUBQUERY)); Thanks, Amit