You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Aleksey Plekhanov (Jira)" <ji...@apache.org> on 2021/11/29 08:26:00 UTC

[jira] [Created] (IGNITE-16013) Calcite engine. Introduce sort-with-limit physical relational operator

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)