lowka commented on code in PR #4221: URL: https://github.com/apache/ignite-3/pull/4221#discussion_r1721263458
########## modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/PlannerHelper.java: ########## @@ -343,4 +360,171 @@ static boolean hasSubQuery(SqlNode node) { return super.visit(call); } } + + + /** + * Tries to optimize a query that looks like {@code SELECT count(*)}. + * + * @param planner Planner. + * @param txContext Transactional context. + * @param node Query node. + * @return Plan node with list of aliases, if the optimization is applicable. + */ + public static @Nullable Pair<IgniteRel, List<String>> tryOptimizeSelectCount( + IgnitePlanner planner, + @Nullable QueryTransactionContext txContext, + SqlNode node + ) { + if (txContext != null && txContext.explicitTx() != null) { + return null; + } + + if (!(node instanceof SqlSelect)) { + return null; + } + + SqlSelect select = (SqlSelect) node; Review Comment: Thanks. Fixed. -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org