my-ship-it commented on code in PR #1398:
URL: https://github.com/apache/cloudberry/pull/1398#discussion_r2447303179


##########
src/backend/gpopt/translate/CTranslatorDXLToPlStmt.cpp:
##########
@@ -2415,15 +2527,34 @@ CTranslatorDXLToPlStmt::TranslateDXLMotion(
        sendslice->directDispatch.contentIds = NIL;
        sendslice->directDispatch.haveProcessedAnyCalculations = false;
 
+       // set parallel workers if needed
+       ULONG child_index = motion_dxlop->GetRelationChildIdx();
+       CDXLNode *child_dxlnode = (*motion_dxlnode)[child_index];
+       ULONG child_parallel_workers = 
ExtractParallelWorkersFromDXL(child_dxlnode);
+       if (child_parallel_workers > 1)
+       {
+               // Determine parallel workers based on enable_parallel and gang 
type
+               bool supports_parallel = (sendslice->gangType == 
GANGTYPE_PRIMARY_READER ||
+                                         sendslice->gangType == 
GANGTYPE_PRIMARY_WRITER);
+
+               if (enable_parallel && supports_parallel)

Review Comment:
   Why we test enable_parallel here. Should we just use supports_parallel to 
decide whether apply  parallel?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to