Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-3353

Paged Queries: use of LIMIT + OFFSET with ORDER BY

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 4.8.0, 4.8.1
    • Fix Version/s: None
    • Component/s: None
    • Environment:

      Phoenix 4.8.1 Hbase 1.2

      Description

      As per documentation (https://phoenix.apache.org/paged.html)
      SELECT * FROM FOO LIMIT 10 OFFSET 10
      returns rows 11 to 20.

      However when adding ORDER BY:
      SELECT * FROM FOO ORDER BY BAR LIMIT 10 OFFSET 10
      it returns nothing. Only raising the LIMIT with the appropriate OFFSET i.e.
      SELECT * FROM FOO ORDER BY BAR LIMIT 20 OFFSET 10
      will now return rows 11 to 20
      while
      SELECT * FROM FOO LIMIT 20 OFFSET 10
      returns rows 11 to 30

      In short: LIMIT + OFFSET in combo with ORDER BY on non primary key has unexpected returns.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jaspervanams Jasper van Ams
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: