Jackie-Jiang opened a new pull request #5661: URL: https://github.com/apache/incubator-pinot/pull/5661
## Description Currently for selection order-by queries, we always read all selected expressions and insert them into the priority queue. This is very inefficient because most values won't be preserved in the priority queue, especially in cases where lots of expressions are selected but only very few are ordered (e.g. `SELECT * FROM table ORDER BY col`). To resolve the inefficiency, this PR enhanced the `SelectionOrderByOperator` to only read order-by expressions and virtual document id column when not all selected expressions are ordered. After getting the final top documents, it does a second round scan to read the non-order-by expressions to construct the final result. Minor optimization: For selection `LIMIT 0` query, skip constructing `DocIdSetPlanNode` and `FilterPlanNode` and the corresponding operators. ---------------------------------------------------------------- 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. 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