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


##########
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:
   Yep, not need here, left only
   
   ```
           bool            hasAggs;                /* has aggregates in tlist 
or havingQual */
           bool            hasWindowFuncs; /* has window functions in tlist */
           bool            hasSubLinks;    /* has subquery SubLink */
           bool            hasDistinctOn;  /* distinctClause is from DISTINCT 
ON */
           bool            hasRecursive;   /* WITH RECURSIVE was specified */
           List       *cteList;            /* WITH list (of CommonTableExpr's) 
*/
   ```



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