Jackie-Jiang commented on code in PR #10042: URL: https://github.com/apache/pinot/pull/10042#discussion_r1061857493
########## pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/SingleConnectionBrokerRequestHandler.java: ########## @@ -106,13 +106,36 @@ protected BrokerResponseNative processBrokerRequest(long requestId, BrokerReques serverBrokerRequest.getPinotQuery().putToQueryOptions(CommonConstants.Broker.Request.TRACE, "true"); } + // broker short-circuit for `select` and `select distinct` queries without `ORDER BY` + boolean orderByPresent = false; Review Comment: Checking if select is present is not enough to determine if the query is select/select distinct. We can use `!QueryContextUtils.isAggregationQuery(query) && query.getOrderByExpressions() == null`, but we will need to first construct the `QueryContext` from the `PinotQuery`. This conversion is not very cheap, so we should try to do this conversion only once in the request handler, and pass it to the reducer -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org