Aleksey Plekhanov created IGNITE-16013:
------------------------------------------

             Summary: Calcite engine. Introduce sort-with-limit physical 
relational operator
                 Key: IGNITE-16013
                 URL: https://issues.apache.org/jira/browse/IGNITE-16013
             Project: Ignite
          Issue Type: Improvement
            Reporter: Aleksey Plekhanov


Currently, sort and limit are different physical relational operators, but in 
some cases, sort combined with a limit can be more effective. For example 
{{ORDER BY x LIMIT 1}} requires to store only one row and can be processed with 
{{O(rowsCount)}} operations. In general. {{ORDER BY x LIMIT m}} requires 
{{O(min(rowsCount, m))}} memory and have {{O(rowsCount * ln(min(rowsCount, 
m)))}} complexity.
Since {{Limit}} node can't be moved below the {{Exchange}} node, {{ORDER BY x 
LIMIT m}} clause should produce two nodes: {{Limit}} node, with single 
distribution, and {{SortWithLimit}} node, which can be moved below the 
{{Exchange}} node and can reduce network traffic.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to