On Wed, Feb 24, 2021 at 2:14 PM Greg Nancarrow <gregn4...@gmail.com> wrote: > > On Wed, Feb 24, 2021 at 3:12 PM Amit Kapila <amit.kapil...@gmail.com> wrote: > > > > On Wed, Feb 24, 2021 at 8:41 AM Greg Nancarrow <gregn4...@gmail.com> wrote: > > > > > > On Tue, Feb 23, 2021 at 10:53 PM Amit Kapila <amit.kapil...@gmail.com> > > > wrote: > > > > > > > > > But the non-parallel plan was chosen (instead of a parallel plan) > > > > > because of parallel-safety checks on the partitions, which found > > > > > attributes of the partitions which weren't parallel-safe. > > > > > So it's not so clear to me that the dependency doesn't exist - the > > > > > non-parallel plan does in fact depend on the state of the partitions. > > > > > > > > > > > > > Hmm, I think that is not what we can consider as a dependency. > > > > > > > > > > Then if it's not a dependency, then we shouldn't have to check the > > > attributes of the partitions for parallel-safety, to determine whether > > > we must use a non-parallel plan (or can use a parallel plan). > > > Except, of course, we do have to ... > > > > > > > I don't think the plan-dependency and checking for parallel-safety are > > directly related. > > > > That is certainly not my understanding. Why do you think that they are > not directly related? > This whole issue came about because Amit L pointed out that there is a > need to add partition OIDs as plan-dependencies BECAUSE the checking > for parallel-safety and plan-dependency are related - since now, for > Parallel INSERT, we're executing extra parallel-safety checks that > check partition properties, so the resultant plan is dependent on the > partitions and their properties. >
He has pointed out an issue when the plan is parallel and you can see in that example that it fails if we didn't invalidate it. For non-parallel plans, there won't be any such issue. -- With Regards, Amit Kapila.