On Fri, Oct 23, 2020 at 6:58 PM Ashutosh Sharma <ashu.coe...@gmail.com> wrote: > > > > > I think, if possible, all these if-else checks in CopyFrom() can be > > moved to a single function which can probably be named as > > IdentifyCopyInsertMethod() and this function can be called in > > IsParallelCopyAllowed(). This will ensure that in case of Parallel > > Copy when the leader has performed all these checks, the worker won't > > do it again. I also feel that it will make the code look a bit > > cleaner. > > > > Just rewriting above comment to make it a bit more clear: > > I think, if possible, all these if-else checks in CopyFrom() should be > moved to a separate function which can probably be named as > IdentifyCopyInsertMethod() and this function called from > IsParallelCopyAllowed() and CopyFrom() functions. It will only be > called from CopyFrom() when IsParallelCopy() returns false. This will > ensure that in case of Parallel Copy if the leader has performed all > these checks, the worker won't do it again. I also feel that having a > separate function containing all these checks will make the code look > a bit cleaner. >
In the recent patch posted we have changed it to simplify the check for parallel copy, it is not an exact match. I feel this comment is not applicable on the latest patch Regards, Vignesh EnterpriseDB: http://www.enterprisedb.com