Ali Alsuliman created ASTERIXDB-2292:

             Summary: Selecting the kth element from a subquery with ORDER BY
                 Key: ASTERIXDB-2292
             Project: Apache AsterixDB
          Issue Type: Improvement
          Components: COMP - Compiler
            Reporter: Ali Alsuliman

(select * from GBU g order by[k]

The plan for the above query orders, then listifies the result only to pick the 
kth element.

The query should be turned into:

select * from GBU g order by limit 1 offset k

This is especially important when k = 0

This message was sent by Atlassian JIRA

Reply via email to