jiaqizho commented on code in PR #900:
URL: https://github.com/apache/cloudberry/pull/900#discussion_r1953675890


##########
src/backend/optimizer/plan/planner.c:
##########
@@ -342,6 +343,47 @@ planner(Query *parse, const char *query_string, int 
cursorOptions,
        return result;
 }
 
+/* Check if query too simple to use optimizer */
+bool enabled_for_optimizer(Query *parse)
+{
+       int num_relations = 0;
+       ListCell   *l;
+
+       if (optimizer_relations_threshold == 0)
+               return true;
+
+       if (parse->hasAggs || parse->hasWindowFuncs || parse->hasTargetSRFs || 
parse->hasSubLinks || parse->hasRecursive || parse->cteList)

Review Comment:
   `hasModifyingCTE` maybe? CTE exploring/implements is different in ORCA and 
PG.



-- 
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